Method 'Open' of object 'Workbooks' failed.

M

mike

Please give me a hand.

The source code in VB 6 is something looks like as
follow:

Dim ExcelObj As Excel.Application
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.Workbooks.Open App.path & "\" & "myTable.xls"
....

It works well on any combination environment between:
Windows 98/2000/XP and Excel 97/2000/XP, except Office 97
and Windows XP.

When running the 3th line on Windows XP with Office 97,
the problem happened with "Method 'Open' of
object 'Workbooks' failed".

Thanks.
 
H

Harlan Grove

...
...
Dim ExcelObj As Excel.Application
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.Workbooks.Open App.path & "\" & "myTable.xls"
...

It works well on any combination environment between:
Windows 98/2000/XP and Excel 97/2000/XP, except Office 97
and Windows XP.

When running the 3th line on Windows XP with Office 97,
the problem happened with "Method 'Open' of
object 'Workbooks' failed".

Presumably the second line varies for different Excel versions?

What's App.path?

Are you certain that user permissions for this file are identical in all of
these environments?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top