Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Excel VBA can't save as pdf anymore

Explorer ,
Jan 11, 2025 Jan 11, 2025

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?

399
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2025 Jan 11, 2025

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 11, 2025 Jan 11, 2025

Sorry, I'm new... Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2025 Jan 11, 2025

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 11, 2025 Jan 11, 2025
LATEST

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines