OLE, VB3, access cells from many sheets in a single .XLW workbook 
Author Message
 OLE, VB3, access cells from many sheets in a single .XLW workbook

How do I access cells in Visual Basic 3 from many spreadsheets which are
contained in a single Excel 5 .XLW workbook file? I'm using OLE
automation to do that.

I have no problem accessing cells within a single .XLS file.

I have searched the online help files (VB 3 and XL 5, not any XL
development kits) and manuals and tried various crazy ideas, but I'm
stuck. Any help?
--



Wed, 21 Oct 1998 03:00:00 GMT  
 OLE, VB3, access cells from many sheets in a single .XLW workbook


Quote:

>How do I access cells in Visual Basic 3 from many spreadsheets which are
>contained in a single Excel 5 .XLW workbook file? I'm using OLE
>automation to do that.

>I have no problem accessing cells within a single .XLS file.

>I have searched the online help files (VB 3 and XL 5, not any XL
>development kits) and manuals and tried various crazy ideas, but I'm
>stuck. Any help?
>--


I have never used VB3, but I have used the following in 16 bit VB4.

Dim xl As Excel.Application
Dim xlb As Excel.Workbook
Dim xls1 As Excel.Worksheet
Dim xls2 As Excel.Worksheet

Set xl = CreateObject("Excel.Application")
Set xlb = xl.Workbooks.Open("C:\MODELS\SCRIPTS\OUTPUT2.XLS")
Set xls1 = xlb.Worksheets("Sheet1")
Set xls2 = xlb.Worksheets("Sheet2")

MyVar1 = xls1.Range("A1").Value
xls1.Range("K5").Value = "Blah"

MyVar2 = xls2.Range("A1").Value
xls2.Range("K5").Value = "Blah"

_________________________________________
Mike Thompson
BHP NZ Steel
Auckland
New Zealand

_________________________________________



Thu, 22 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using Excel workbooks and sheet from Access

2. VB or Excel VBA, accessing list of all the sheets in a workbook

3. OLE VB to Excel , RESUME.XLW File

4. Access OLE object insert Excel sheet

5. I want to email excel sheets in a workbook

6. Word2000 Mail merge from selected sheet in Excel workbook

7. Selecting multiple sheets in an Excel workbook

8. Err 1004: Excel Workbook/Sheet Activate

9. Copy an Excel sheet without opening the workbook.

10. Somebody please help me to create an Excel Workbook w/sheets from VB4.0

11. Excel VBA: search multiple-sheets in a workbook

12. SELECT * INTO - XL workbook Multiple sheet SQL error

 

 
Powered by phpBB® Forum Software