PDA

Click to See Complete Forum and Search --> : Reading Excel File from VB6


sblouet
Nov 30th, 1999, 11:33 AM
I need to open and read an Excel 97 file. Previously I have managed to create an Excel workbook and write to it using the following code:
Set objXLapp = CreateObject("Excel.Application")
Set objXLbook = objXLapp.Workbooks.Add
Set objXLsheet = objXLapp.Worksheets(1)

I thought that I could use a similar method for opening an existing Excel file. But I have had no sucess in finding the right code.

Has anyone got any ideas or pointers?

All help appreciated

Al Smith
Nov 30th, 1999, 11:43 AM
Try:

Set objXLsheet = GetObject("full pathname")
objXLsheet.Application.Visible=True
objXLsheet.Parent.Windows(1).Visible=True

Al.