Results 1 to 2 of 2

Thread: Reading Excel File from VB6

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    10

    Post

    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

  2. #2
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Try:

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

    Al.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width