Method 'Open' of object 'Workbooks' failed.

  • Thread starter Thread starter mike
  • Start date Start date
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.
 
...
...
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?
 
Back
Top