+ Reply to Thread
Results 1 to 10 of 10

run-time error '1004' method 'open' of object 'workbooks' failed

  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    run-time error '1004' method 'open' of object 'workbooks' failed

    My code is below. It works when I open the link withount using the macro.

    When I use:
    HTML Code: 
    It opens but the pivit tables wont work and all the colors are gone.

    When I open it without the CorruptLoad:=xlExtractData I get:

    run-time error '1004' method 'open' of object 'workbooks' failed

    How can I get this puppy to work and be able to use it like if I were to open it as a link without the macro.

    Thanks

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: run-time error '1004' method 'open' of object 'workbooks' failed

    What happens if you just try to open it from Excel? Do you get a message that the file is corrupt?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: run-time error '1004' method 'open' of object 'workbooks' failed

    Yes, it does. I tried adding the CorruptLoad:=xlExtractData and it opens but all the pivits are gone and it looks like a raw file, no borders, no colors, and you cant move stuff around.

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: run-time error '1004' method 'open' of object 'workbooks' failed

    You may try CorruptLoad:=xlRepairFile
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  5. #5
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: run-time error '1004' method 'open' of object 'workbooks' failed

    Thanks... That mostly worked. The file came up correctly and not looks right and I can pivit it. Another box poped up saying: Excel was unable to open the file by repairing the unreadable content.

    and then I can hit exit and exit out of it and go on with life. Is there anything i can add to exit that for me?

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: run-time error '1004' method 'open' of object 'workbooks' failed

    I do not know if it will work for this but you may try:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: run-time error '1004' method 'open' of object 'workbooks' failed

    That worked like a champ because your a champ. Thanks bud. Awesome. That save me so much time from doing my reports manually.

  8. #8
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: run-time error '1004' method 'open' of object 'workbooks' failed

    You are welcome. I think that I would be worried about the corrupt file!

  9. #9
    Registered User
    Join Date
    06-10-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: run-time error '1004' method 'open' of object 'workbooks' failed

    That helped me a great deal too. Thanks you soooo much. Cheers. God Bless.

  10. #10
    Registered User
    Join Date
    05-03-2016
    Location
    Auckland, New Zealand
    MS-Off Ver
    MS 2013
    Posts
    1

    Talking Re: run-time error '1004' method 'open' of object 'workbooks' failed

    Thanks so much! It works perfect for my marco.

+ 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. me too - run-time error '1004' method 'range' of object '_worksheet' failed
    By ASAFSWIS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2013, 05:14 PM
  2. Help! Why am I getting Run-time error '1004': Method 'Range' of object'_Gloabl' Failed
    By ExcelNewbeee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2012, 05:35 PM
  3. Run-time error '1004': Method 'Range' of object '_ Global' failed
    By mdvc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2011, 11:48 AM
  4. Run time error 1004 - Method 'Range' of 'Object'_Global' failed
    By excelaspire0219 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-10-2009, 01:18 PM
  5. Run-time error '1004'; Method 'Export' of object'_Chart' failed
    By Father Guido in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2005, 10:35 AM

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