Skip to main content
Known Participant
Jan 11, 2025 12:39 PM UTC
Question

Excel VBA can't save as pdf anymore

After years working, since 2025-01-06 my Excel VBA macros saving a worksheet as pdf get "run-time Error 1004 - Document not saved. Maybe the file is open or troubles when saving".  The stopping command is

 ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fn, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
The worksheet copied with these macros on a second PC still works smoothly. The two PCs are updated and aligned:

Windows 10 Pro (upd KB5048652)

Microsoft® Excel® for Microsoft 365 MSO (Version 2412 Build 16.0.18324.20092) 64 bit

VBA 7.0.1

Adobe Acrobat Pro v. 2024.005.20320 (un- and re-installed)

On both, however, also exporting the pdf manually with the PDFMaker plugin is VERY long and troubled, Excel hangs for minutes and the worksheet is forced-closed and re-opened at the end by the PDFMaker plugin. Last, manually Saving As .pdf in the File dialog works smoothly in the second PC, while gives the same "Document not saved" msg in the "bugged" one.

Did anyone meet a similar bug?

4 replies

try67
Community Expert
Community Expert
Jan 11, 2025 10:24 PM UTC

This looks like a Microsoft issue, not an Adobe one. That command doesn't use Acrobat to generate the file, as far as I can see.

Translate
Known Participant
Jan 11, 2025 11:54 PM UTC

Many thanks, you're probably right. Actually I can't say which piece of software is involved, I thought that maybe the Adobe plugin PDFMOfficeAddin.dll could play some role. And every other output format but .pdf works normally in the VBA macros. 

Translate
Peru Bob
Community Expert
Community Expert
Jan 11, 2025 6:41 PM UTC

I've moved this from the Using the Community forum (which is the forum for issues using the forums) to the Acrobat forum so that proper help can be offered.

Scroll down here to see a list of the forums:
https://community.adobe.com/

Translate
Known Participant
Jan 11, 2025 11:46 PM UTC

Sorry, I'm new... Thank you

Translate