+ Reply to Thread
Results 1 to 6 of 6

Once successful VBA now elicits Run-time error '1004': Document not saved.

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Excel 2016
    Posts
    52

    Once successful VBA now elicits Run-time error '1004': Document not saved.

    Hello,

    The code below used to work with no issue. Recently is elicits the following: Run-time error '1004': Document not saved. The document may be open, or an error may have been encountered when saving.

    The point of the code is to save a ststement created in excel to .pdf in a specific directory. The error has been produced on different computers, and I changed the destination directory so I don't believe it is an overwriting issue. The debug takes me to the code below.

    Thoughts?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Once successful VBA now elicits Run-time error '1004': Document not saved.

    What does the filename argument resolve to?
    Please Login or Register  to view this content.
    Last edited by shg; 07-31-2017 at 12:37 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Excel 2016
    Posts
    52

    Re: Once successful VBA now elicits Run-time error '1004': Document not saved.

    It produces no output. "I8" is a cell which contains the file path. Cells (i, 4) is the participant's name and Range ("A4") contains a date. So the .pdf is saved to a particular location and given the name of a participant and date.

    The code worked in the past, so I don't understand why it doesn't any longer.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Once successful VBA now elicits Run-time error '1004': Document not saved.

    What produces no output?

    Did you not understand my question?

  5. #5
    Registered User
    Join Date
    07-31-2012
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Excel 2016
    Posts
    52

    Re: Once successful VBA now elicits Run-time error '1004': Document not saved.

    As I was about to write "of course the file path is correct" I followed the file path to make sure it was. It was then I noticed someone had altered the name of the directory itself. As soon as I made that correction to excel, it is working once again. Thank you shg!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Once successful VBA now elicits Run-time error '1004': Document not saved.

    You're welcome.

+ 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] Runtime Error 1004: Document Not Saved (ExportAsFixedFormat)
    By Sophie.Durrant in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2015, 11:16 AM
  2. Replies: 0
    Last Post: 12-16-2014, 10:12 AM
  3. Run-time error 1004 Document not saved....
    By ey_up in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2014, 04:47 AM
  4. Run-time error '1004': Document Not Saved (while using LockXLS)
    By lottidotti in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-25-2013, 12:14 PM
  5. Excel 2007 : Run Time Error 1004 - Document not saved
    By Villamankh in forum Excel General
    Replies: 2
    Last Post: 12-17-2010, 09:44 AM
  6. Run-time error '1004'; Document not saved - intermittent
    By Kerry in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-15-2005, 07:15 PM
  7. 'Document not saved' error
    By Optiglaze in forum Excel General
    Replies: 0
    Last Post: 08-03-2005, 04:05 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