Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Error 1004 opening workbook 1004

Hi all

I have this code to open 3 workbooks, but of late, the second line fails
with the Error 1004 Open Method of Object failed. I've checked that the file
is called the same (it is), that it's in the right directory (it is), that
someone else doesn't have it open (no-one does) and that there are no typos
(I don't think there are!). If I remove the second line, it works fine. I'm
at a loss what else to look for, any suggestions as to how to find what's
wrong would be great:


Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\USED SALES.xls"

Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\CONTRACTS.xls"

Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\CENTRAL OVERHEADS.xls"


Thanks
Martyn
--
Excel 2000, Windows 2003 over Citrix PS4
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,203
Default Error 1004 opening workbook 1004

Can you open the Contracts.xls workbook by itself normally, either by
double-clicking it in a file browser or by navigating to it from within
Excel? It may be a problem with the file itself.

Otherwise you might try deleting that line of code and re-entering it, or
even copying all of the code in that module to a new module and deleting the
old module.

"WembleyBear" wrote:

Hi all

I have this code to open 3 workbooks, but of late, the second line fails
with the Error 1004 Open Method of Object failed. I've checked that the file
is called the same (it is), that it's in the right directory (it is), that
someone else doesn't have it open (no-one does) and that there are no typos
(I don't think there are!). If I remove the second line, it works fine. I'm
at a loss what else to look for, any suggestions as to how to find what's
wrong would be great:


Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\USED SALES.xls"

Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\CONTRACTS.xls"

Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\CENTRAL OVERHEADS.xls"


Thanks
Martyn
--
Excel 2000, Windows 2003 over Citrix PS4

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Error 1004 opening workbook 1004

Try opening the file and in the immediate window type this

? ActiveWorkbook.FullName


--
HTH,

Barb Reinhardt



"WembleyBear" wrote:

Hi all

I have this code to open 3 workbooks, but of late, the second line fails
with the Error 1004 Open Method of Object failed. I've checked that the file
is called the same (it is), that it's in the right directory (it is), that
someone else doesn't have it open (no-one does) and that there are no typos
(I don't think there are!). If I remove the second line, it works fine. I'm
at a loss what else to look for, any suggestions as to how to find what's
wrong would be great:


Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\USED SALES.xls"

Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\CONTRACTS.xls"

Workbooks.Open Filename:="X:\ACCOUNTS-EAST\New MA Project\Management
Accounts\2009\CENTRAL OVERHEADS.xls"


Thanks
Martyn
--
Excel 2000, Windows 2003 over Citrix PS4

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro runtime 1004 error on opening worksheet Shaggyjh Excel Discussion (Misc queries) 5 May 6th 09 12:37 PM
Opening a workbook, passwords and error 1004. droopy928gt[_10_] Excel Programming 2 April 27th 06 01:23 PM
workbook.open throws 1004 error [email protected] Excel Programming 3 April 3rd 06 11:37 PM
shared workbook runtime error 1004 Nigel[_10_] Excel Programming 10 August 2nd 05 07:09 PM
runtime error 1004 when opening excel file via VBA in a browser Ken Hunter Excel Programming 2 July 31st 03 03:33 PM


All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"