-
Report Generator Fix - Run-time error '1004': Doc not saved
Hi everyone, new to the forums, as well as VBA. Trying to fix a Run-time error '1004' when I attempt to generate a report in Excel.
After the error, clicking debug highlights this line of code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPDFFileName
Is there an obvious mistake I'm making here or will I need to include some more information?
Appreciate the help.
-
There is a "Document not saved" error if that PDF file is open on the PC.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
File wasn't open, but already existed. All I had to do was change the filename, lol very silly but thank you.
-
You can use the Kill command to delete an existing file before creating a new version.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules