+ Reply to Thread
Results 1 to 4 of 4

SaveCopyAs Runtime Error 1004

  1. #1
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    SaveCopyAs Runtime Error 1004

    This is so frustrating! I have a simple macro in my personal workbook to take filename and path information as parameters and save backup copies using the SaveCopyAs method. I have set up multiple workbooks to call this macro before save. All was working fine until this week, when one of my workbooks decided to arbitrarily start crashing on save. All other workbooks that call this method still work perfectly and the problematic workbook sometimes works as well. Does anyone have any idea what might be the issue?

    Observations:
    1) It works fine if I open the workbook, make no changes, and save as usual.
    2) It works fine if I open the workbook, make changes within the workbook and save as usual.
    3) It works fine if I have any other random workbook open when I try to save.
    4) The workbook with the issue has a form that opens another workbook. No code on either workbook has been changed since the days when it worked correctly. If I have opened the other workbook using the form, it crashes on save. This happens regardless of if the other workbook is still open at save time or not.
    5) The autosave backup method still works almost every time (the macro runs, the confirmation message box pops up at the end, the autosaved file exists where it should) but when it tries to actually save, it crashes.
    6) Sometimes is pops up error 1004 and says something like Method does not exist (I can't get it to come up now and I didn't screenshot).
    7) In the folder where the original workbook copy should have been saved, the last save version prior to the crash is saved (so the actual save is not working). Also, for each crash, there is a file of file type FILE, 0 bytes, named XXXXX000 where the exes are random numbers/characters.
    8) If change the BeforeSave code in the workbook to not call from the personal workbook but recreate the code, it behaves the same (crashes most of the time).

    The problem workbook is quite large (>1500 KB) so I'm thinking maybe it has something to do with memory? The only thing that has changed since it was working is the size of the workbook...

    If anyone knows why this might be happening I will be very grateful. Thank you.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: SaveCopyAs Runtime Error 1004

    Is that the full code? Or are you enetering the path and file ext in a form.
    This should work, but I am not sure if this is the way you want to go about this.

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: SaveCopyAs Runtime Error 1004

    Thank you for the reply. I did end up solving this by installing the latest service pack from Microsoft. That was the full code. It has worked perfectly since updating the software.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: SaveCopyAs Runtime Error 1004

    @ yay_excel

    Based on your last post it seems that you resolved your issue but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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