Fix Excel for Mac Crashes During Repeated PDF Exports
Question details
Identify why Excel for Mac crashes when a VBA macro repeatedly recalculates worksheets and exports reports as PDFs.

- 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.
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.
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.
In Excel, choose Help > Check for Updates and install any available Office updates. Restart Excel before testing the macro again.
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.
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").
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.
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.
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.

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.

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.




