Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 5 of 5

Thread: error 1004 excel vba workbooks.open

  1. #1
    Join Date
    4th May 2011
    Posts
    3

    error 1004 excel vba workbooks.open

    Hi all.
    Before I decided to write this post, I had a look trying to google my stupid error, but I couldn't find anything that looks exactly like my issue.
    VB:
    Workbooks.Open Filename:="c:\files\clients.xlsx" 
    Workbooks("clients.xlsx").Worksheets(1).Range("a1" & ":x500").Copy _ 
    Workbooks("cash").Worksheets(2).Range("A1") 
    
    
    The thing is that on my computer at work (windows 7 enterprise with office 2007 professional) the code runs without any problem.
    And when I opened the same file on my laptop (same SO, same office) appear the following error: Run-time error '1004' Method 'Open' of object 'Workbooks' failed.
    Please! Help!

    Thank you in advance.
    Gabi

    P.S. By the way. Very nice job with this site, guys!

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    1st September 2010
    Posts
    7,744

    Re: error 1004 excel vba workbooks.open

    Strangely enough, if the file does not exist, Excel throws a 1004 File not found error rather than the 'real' file not found error which is Error 53.
    Are you absolutely sure the file you're referencing exists and is not corrupt?

    Excel Video Tutorials / Excel Dashboards Reports


  3. #3
    Join Date
    4th May 2011
    Posts
    3

    Re: error 1004 excel vba workbooks.open

    Quote Originally Posted by cytop View Post
    Strangely enough, if the file does not exist, Excel throws a 1004 File not found error rather than the 'real' file not found error which is Error 53.
    Are you absolutely sure the file you're referencing exists and is not corrupt?
    Hello.

    Thank you for replying so fast.

    I'm absolutely sure that the file exists and is not corrupted.
    Gabi

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    4th May 2011
    Posts
    3

    Re: error 1004 excel vba workbooks.open

    hmmm...
    strangely enogh, you were right. that file was corrupt.
    I've spent a whole day trying to figure it out.

    Thank you very much.

    Best regards,
    Gabi

    Excel Video Tutorials / Excel Dashboards Reports


  5. #5
    Join Date
    20th September 2011
    Posts
    1

    Re: error 1004 excel vba workbooks.open

    I have experienced this same issue and the resolution was to do a "File/Save As" and re-save the file on your drive. This enables excel to "see" the drive mapping where it is saved and will permit the code to run.

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Replies: 2
    Last Post: June 25th, 2011, 06:01
  2. Replies: 6
    Last Post: November 24th, 2010, 06:31
  3. Replies: 5
    Last Post: June 28th, 2007, 19:42
  4. Replies: 1
    Last Post: August 2nd, 2006, 11:34
  5. VBA : EXCEL - Run-time Error 1004
    By sakieboy in forum EXCEL HELP
    Replies: 6
    Last Post: January 30th, 2004, 23:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
porno