Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Norman,
Yep, I had, was getting a 424 due to my own stupidity. I just replaced the "Workbooks.Open..." with "xlapp.workbooks.open..." - without defining xlapp and creating the Object. Evidently not enough coffee yet. I've now done so, and the workbook is opening. Thanks for your help, much appreciated! "Norman Jones" wrote: Hi DS, Have you tried replacing the named arguments with position values, as in my later response? --- Regards. Norman "DS" wrote in message ... Hi Norman, Thanks for your suggestion, unfortunately, preceding with an "xlapp." just gives me an "Object Required" error. The code prior to the workbooks.open statement simply defines the TargetPath and TargetBook - as I said, these work fine from run within Excel, and ok when stepping through the code when opened in IE, so it doesn't appear to be these which is causing the problem. For the sake of completion, though, the full code concerned (edited) is: TargetPath = "\\server1\shared\Level1\Level2\Level3\DataTables\ " If Range("Sheet1!C2") = "HeaderRequired" Then TargetBook = "Table1.xls" Else TargetBook = "Table2.xls" End If Workbooks.Open Filename:=TargetPath & TargetBook, Password:="xxx", WritePassword:="xxxx" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open all workbooks inside a folder, run macro and save them? | Excel Programming | |||
Unexpected error 1004 when using workbooks.open | Excel Programming | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
excel workbooks.close returns 1004 error | Excel Programming | |||
Error 1004 when I open a file | Excel Programming |