Office Apps Crashing

Fix Excel for Mac Crashes During Repeated PDF Exports

Ayan MasoodAyan Masood Nov 14, 2026 869 views

Question details

Identify why Excel for Mac crashes when a VBA macro repeatedly recalculates worksheets and exports reports as PDFs.

Fix Excel for Mac Crashes During Repeated PDF Exports
Product
Microsoft Excel for Mac
Device & OS
macOS
Scenario
A VBA procedure updates report worksheets, recalculates them, changes page settings, and exports multiple PDF reports.
Observed behavior
Excel crashes during repeated PDF exports, while normal printing and runs with fewer reports work.
Before you start

Note how many reports the macro exports before Excel crashes and identify the ExportAsFixedFormat call in the VBA editor. Check whether worksheet event handlers and PageSetup changes run in the same loop.

Solution 1Recommended

Isolate the VBA PDF export crash in Excel for Mac

Use these checks to narrow down whether the crash is associated with worksheet events, page settings, or repeated PDF exports.

1
Update Excel

In Excel, choose Help > Check for Updates and install any available Office updates. Restart Excel before testing the macro again.

2
Test without worksheet events

Open the VBA editor from Tools > Macro > Visual Basic Editor and temporarily disable event-driven logic for a test run. If you use Application.EnableEvents = False, add error handling that restores it to True when the macro finishes or fails.

3
Qualify worksheet references

In the VBA editor, replace Select, ActiveSheet, and unqualified Range or Cells references with explicit workbook and worksheet references, such as wb.Worksheets("Report").Range("A1").

4
Simplify page setup

Review the macro's PageSetup assignments, including footer changes, and temporarily remove nonessential changes from the export loop. Run the macro again to see whether the crash still occurs.

5
Export one sheet at a time

Call ExportAsFixedFormat on an explicitly referenced worksheet rather than relying on the selected or active sheet. Start with one PDF, then increase the number of iterations to find when the crash returns.

6
Compare printing and smaller runs

Use File > Print to test normal printing, and run the macro with fewer reports. Record which tests succeed and share the results and relevant VBA code in a Microsoft Office programming forum if the crash continues.

Isolate the VBA PDF export crash in Excel for Mac
Test one change at a time: Re-enable or restore temporarily removed logic after each test so you can identify which change affects the crash.
Free Microsoft Office alternative

Export Spreadsheet Reports to PDF with WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility for an easier move between apps. It can export spreadsheet reports to PDF, though it does not fix Excel's crash and existing VBA automation may require changes.

Export spreadsheet reports to PDF from WPS SpreadsheetsOpen and edit Microsoft Excel XLSX filesUse a familiar interface for everyday spreadsheet workTry a free, lightweight Office alternative
microsoft office alternative - wps office

Frequently Asked Questions

How can I tell whether PDF export is involved in the crash?

Run the macro with fewer PDF exports and compare the result with normal printing through File > Print. If smaller runs and printing work but repeated exports crash, investigate the ExportAsFixedFormat loop.

Why should I avoid ActiveSheet in the export macro?

ActiveSheet depends on which sheet is selected. In the VBA editor, refer to the intended sheet explicitly, such as wb.Worksheets("Report"), before calling ExportAsFixedFormat.

How do I test whether worksheet events contribute to the crash?

Temporarily disable event-driven logic in the VBA editor and repeat the export test. If you set Application.EnableEvents to False, make sure error handling restores it to True.

Will WPS Office run my Excel PDF export macro unchanged?

Not necessarily. WPS Spreadsheets can work with Excel files and export reports to PDF, but VBA compatibility varies, so test any existing automation before relying on it.