VBA & Macro Problems

Fix Excel for Mac VBA ExportAsFixedFormat Printing Instead of Saving a PDF

Amos GikundaAmos Gikunda Nov 13, 2026 869 views

Question details

The user needs an Excel VBA macro to save a worksheet as a PDF instead of printing it on paper.

Fix Excel for Mac VBA ExportAsFixedFormat Printing Instead of Saving a PDF
Product
Microsoft Excel for Mac
Device & OS
macOS
Scenario
A VBA macro calls ExportAsFixedFormat to export the active worksheet as a PDF.
Observed behavior
Running the macro prints to a physical printer instead of producing the expected PDF file.
Before you start

Identify the worksheet to export and choose an existing local folder where Excel can save files. Check whether the filename variable already includes a folder path or the .pdf extension.

Solution 1Recommended

Specify a PDF filename and test the worksheet export

Use an explicit output path and worksheet to rule out an incorrect filename or active sheet.

1
Open the VBA editor

In Excel, open Tools > Macro > Visual Basic Editor and find the macro containing ExportAsFixedFormat.

2
Set a full PDF path

Set the filename to a full path in an existing local folder, including the .pdf extension. For example, replace the placeholder with your Mac username and use: fileName = "/Users/yourname/Documents/report.pdf".

3
Export the intended worksheet

Select the intended worksheet in Excel, then use: ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fileName. Alternatively, refer to a specific worksheet in the macro instead of relying on ActiveSheet.

4
Run and check the file

Run the macro from the VBA editor, then open the chosen folder in Finder and look for report.pdf. If the macro appends ".pdf" to the variable, make sure the variable does not already include that extension.

Specify a PDF filename and test the worksheet export
Check the rest of the macro: ExportAsFixedFormat is intended to create a file. If paper still prints, inspect the rest of the macro and any called procedures for PrintOut or other print commands.
Free Microsoft Office alternative

Export spreadsheets to PDF with WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface for opening Excel files and exporting spreadsheets to PDF. It can help you move between compatible document formats, but it does not fix Excel's VBA export behavior.

Export spreadsheets to PDF without relying on the Excel macroOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface for a smoother transitionWork with a free, lightweight Office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does my macro print on paper when it should export a PDF?

ExportAsFixedFormat is intended to create a PDF file. Check the filename and folder path, then inspect the macro and any procedures it calls for PrintOut or other print commands.

Should the Filename argument include .pdf?

Yes. Supply a complete filename such as /Users/yourname/Documents/report.pdf. If your code appends ".pdf" to a variable, do not include the extension in that variable as well.

How can I test PDF creation without running the macro?

In Excel for Mac, choose File > Print, open the PDF menu in the print dialog, and select the option to save as PDF. Check the destination folder for the file.

Does ActiveSheet always export the sheet I expect?

No. ActiveSheet refers to the sheet active when the macro runs. Select the intended sheet before running the macro or reference the worksheet explicitly in your VBA code.

Can WPS Office fix the Excel VBA macro?

No. WPS Office is an alternative for working with compatible Excel files and exporting spreadsheets to PDF; it does not repair Excel's VBA behavior. Check macro compatibility separately before migrating a VBA-dependent workbook.