+ Reply to Thread
Results 1 to 14 of 14

Run-time error '1004': Method 'Open' of object 'Workbooks' failed

  1. #1
    Registered User
    Join Date
    02-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Hi,
    I have a master workbook and want to run a macro (as per below) which would open another workbook and copy data on a tab from the opened workbook into my master workbook. But each time I try to do that, I get the above 1004 error. Both the files are Binary Workbooks (to keep the file size small) but still touch 35mb each. I was wondering if the file type or file size have anythign to do with the error.

    Any help will be appreciated.


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    02-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Hi, forgot to point out that the line highlighted when the error msg comes up is the

    Set wb1 = Workbooks.Open(Filename:=FileToOpen)

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Hi Krish

    Perhaps this
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    02-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Hi Jas

    Have already tried that and the problem still persists.

  5. #5
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    HiKrish, I am able to execute the code..
    can you share the file which you will browse from the code & work upon?
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  6. #6
    Registered User
    Join Date
    02-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Hi Parth,
    am afraid not! The files are just too big (35mb each, even after converting to a Binary workbook) and one reason why I was checking if the file size ot type has anything to do with the error.

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    not sure if it will fix it but put "" around false

    Please Login or Register  to view this content.

    thats the only error i got from the small scale i used
    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  8. #8
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Can you try to run the code on some small size sample sheets?
    As i was able to pass through the
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Hi Parth,

    I tried to pull data from an older version (33MB) and it worked....for some reason it continues to give the above error for the newer version (which is about 39MB). I am not sure if the latter file is corrupted as it does not throw up any error message when I open it. At my wits end :-(

  10. #10
    Registered User
    Join Date
    02-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Hi Humdingaling,
    Same problem continues.

  11. #11
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Try code..

    Please Login or Register  to view this content.
    and see what u get for the file above 39MB

    Just a Hit & Trial..

  12. #12
    Registered User
    Join Date
    02-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Hi Parth
    Doesn't do anything...doesn't give any error message but doesn't copy any data over either and the macro runs in a jiffy maybe as it is skipping the 'open file' command

  13. #13
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    Ya true.. it do skip the error part..
    still u are able to pull the data in files lower than 39 MB..
    May be huge file is the cause.......

    cant you do something to minimise the size.. i mean excluding extra formating, unwanted data, hyperliks.. refrences etc....

  14. #14
    Registered User
    Join Date
    02-02-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Run-time error '1004': Method 'Open' of object 'Workbooks' failed

    yeah...will try to do that now, Parth. Thanks for your help. If you do come across anything along the above lines with a plausible solution, please do let me know.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] run-time error '1004' method 'open' of object 'workbooks' failed
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-03-2016, 06:24 PM
  2. Run-Time Error '1004': Method 'Visible' of Object'_Worksheet' Failed
    By caltman242 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2015, 10:43 AM
  3. Run-time error '1004: Method 'range' of object'_Global' failed
    By narendrabr in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-01-2014, 05:56 AM
  4. Run-time Error 1004: Method 'SaveCopyAs' of object '_Workbook failed'
    By melissadunham68 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2014, 08:08 AM
  5. Run-time-error 1004 -- Method 'Range' of object '_Global' failed
    By tilleyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2012, 10:55 PM
  6. Run-time error '1004': Method 'Range' of object '_Global' failed
    By claremount in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-26-2010, 08:01 AM
  7. Run time Error '1004: Method 'Cells' of object'_Global' failed
    By Ajay_N in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2006, 11:57 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1