Results 1 to 4 of 4

Run-time error 1004 Document not saved....

Threaded View

  1. #1
    Registered User
    Join Date
    05-19-2014
    Location
    UK
    MS-Off Ver
    Standard 2016
    Posts
    15

    Run-time error 1004 Document not saved....

    Hi all,

    I am running the Macro below to export to pdf a document.

    It has worked perfectly for over a week up until today and I am not sure why I am now getting the error message. It appears that it wont save the pdf at all as the pdf file does not get created or shown on screen.

    My complete macro is actually three modules, copy data to another excel sheet, print sheet and then export copy to pdf. Code as follows:

    Module 1
    Sub Copy_data_base()
    Application.ScreenUpdating = False
    Dim copySheet As Worksheet
    Dim pasteSheet As Worksheet
    
    Set copySheet = Worksheets("Data Collection")
    Set pasteSheet = Worksheets("Database")
    
    copySheet.Range("A6:LW6").Copy
    pasteSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
    End Sub
    Module 2
    Sub Print_Mix_Sheet()
    
    Sheet1.Range("A1:Q39").PrintOut
    
    End Sub
    Module 3

    Sub Export_Mix_Sheet_pdf()
    
    Application.ScreenUpdating = False
        Sheets("Worksheet").Select
        Range("A1:T39").Select
        Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            "\\Server\Folder1\Folder2\Subfolder\" & Range("B2") & " " & Range("C2").Value & " " & Format(Now, "yyyy_mm_dd_hhmmss"), Quality:=xlQualityStandard, IncludeDocProperties:= _
            True, IgnorePrintAreas:=True, OpenAfterPublish:=True
            
        Sheets("Worksheet").Select
        Range("B1").Select
        
        Application.ScreenUpdating = False
    End Sub
    Module 4

    Sub Button_1()
        Call Copy_data_base
        Call Print_Mix_Sheet
        Call Export_Mix_Sheet_pdf
    End Sub

    The error message I get today is Run-time error 1004: Document not saved. The document may be open, or an error may have been encountered when saving.

    Please could somebody offer me an explanation as to why this has suddenly started happening and how I may be able to go about fixing it? I suspect the pdf engine is running in the background but looking at active processes I can see only the adobe update which as it happens doesnt appear to show an update is in progress.

    Thank you for any help.

    Thank you
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 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
  2. Document not saved error
    By firefly2k8 in forum Excel General
    Replies: 0
    Last Post: 02-01-2011, 12:37 PM
  3. 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
  4. [SOLVED] 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
  5. '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