+ Reply to Thread
Results 1 to 3 of 3

Error 1004 Application-defined or object-defined error on Workbook.Close?

  1. #1
    Registered User
    Join Date
    03-09-2015
    Location
    OC, CA
    MS-Off Ver
    2010
    Posts
    25

    Error 1004 Application-defined or object-defined error on Workbook.Close?

    Hey all,

    I have a tool that iterates through a file and saves all the new scripts (pretend I have 100 characters which all have scripts of 3 - 110 lines) separately with the name of the character. For some reason I get an Error 1004 on ActiveWorkbook.Close on one of the characters scripts. The only difference I can tell between the working scripts and this one failed one, is that the failed script has more than 100 lines. I have tried DoEvents, I have tried turning savechanges to false but still the same error. Help me Obi-Wan Kenobi.

    Bonus points if you can figure out why I get an error when the iteration is completed successfully...

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,603

    Re: Error 1004 Application-defined or object-defined error on Workbook.Close?

    Hi there,

    If the code works successfully in the majority of cases, then the problem is almost certainly related to the data you are processing, but unfortunately you give us no idea of what data are involved.

    Can you post a copy of your workbook so that we have a better chance of determining what is/isn't happening?

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    03-09-2015
    Location
    OC, CA
    MS-Off Ver
    2010
    Posts
    25

    Re: Error 1004 Application-defined or object-defined error on Workbook.Close?

    Hey Greg,

    Unfortunately I can't, when I redact the data it fixes the problem. So clearly it's an issue with the data, unfortunately it looks identical to the working data so I am totally stumped :/

+ 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] Error message: Run-Time error '1004 '; application-defined or object-defined error
    By Davasu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2015, 06:52 AM
  2. Replies: 1
    Last Post: 10-22-2015, 05:50 AM
  3. Replies: 5
    Last Post: 08-19-2015, 07:10 PM
  4. VBA ERROR: run time error 1004: Application-defined or Object-defined error in excel 2013
    By AnanthKrishna in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2015, 06:16 AM
  5. [SOLVED] Error " Run-time error '1004': application defined or object defined error
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:26 AM
  6. [SOLVED] run-time error '1004' application-defined or object-defined error - Excel 2007
    By kaurka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2012, 02:46 AM
  7. Replies: 2
    Last Post: 09-12-2012, 01:01 PM

Tags for this Thread

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