View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.crashesgpfs,microsoft.public.excel.programming
Dan Merchant Dan Merchant is offline
external usenet poster
 
Posts: 7
Default Workbooks.Open fails after upgrade to XL2000 from XL97

Frank,

What exactly is failing? I can run your three lines of code in Excel XP
without error. Have you tried placing a break point in your code so you can
see exactly what line of code is causing the error?


"Frank" wrote in message
...
I have a workbook with a number of macros and forms in it.
It had been working fine under XL97. I have upgraded to
XL2000 and now it fails. The code is:

bookVBInput = Application.GetOpenFilename(, , "Open VB
Input File")
If bookVBInput = False Then Exit Sub
Workbooks.Open FileName:=bookVBInput

When the Workbooks.Open statment is executed I get a
dialog saying:

Runtime error '1004'
Application-defined or object-defined error

The code is in ThisWorkbook object and is in routine:

Public Sub Components_CreateFromVB()

The routine is called from a form button code which is:

Private Sub CommandButtonCreateComponents_Click()

Call ThisWorkbook.Components_CreateFromVB

End Sub

When I get the dialog and click on the Debug button, the
execution point is back at the call, not on the open
statement.

Any ideas?

Thanks,
Frank Clifton