Troubleshoot Excel Crashes When a VBA Macro Refreshes PivotTables
Question details
Determine why Excel crashes when a VBA macro refreshes PivotTables after an Office update.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user runs a VBA macro that refreshes PivotTables after an Office update.
- Observed behavior
- Excel crashes during the refresh in the latest workbook and build. Reinstalling Office temporarily resolves the issue, but it returns after an update.
In Excel, check File > Account for the installed Office version and build, and compare it with a build that works if available. Run macros only from trusted workbooks, and make sure the PivotTable data source is accessible before testing.
Test the PivotTable refresh macro in a new workbook
Use a new workbook to determine whether the crash is specific to one file or affects Excel more broadly.
Select File > New > Blank workbook, add representative source data, and use Insert > PivotTable to create a test PivotTable.
Open Developer > Visual Basic and copy the relevant refresh macro into a module in the test workbook. Adjust workbook, sheet, PivotTable, and data source references as needed.
Use File > Save As to save the test as an Excel Macro-Enabled Workbook (.xlsm), then run the macro from Developer > Macros.
If the test workbook also crashes, investigate the Office build. If only the original workbook crashes, test its contents in a new workbook.

Rebuild the affected workbook if the crash is file-specific
Use this approach when the macro works in a new workbook but crashes in the original file.
Review the Office build and rollback guidance
Consider a build-related issue when the refresh crashes across workbooks or began after an Office update.
Work with PivotTable spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility for an easier transition. It does not repair an Excel-specific crash; check any VBA-dependent workflow separately before migrating.

Frequently Asked Questions
How can I tell whether the crash is caused by one workbook?
Create a new workbook with Insert > PivotTable, add a representative refresh macro through Developer > Visual Basic, and run it. If only the original file crashes, investigate that workbook's contents, connections, and PivotTables.
Where can I find my Excel build number?
Open Excel and select File > Account. Look for the Office version and build information, then compare it with a working installation or Microsoft's Office update history.
Can I roll back an Office update?
For Office Click-to-Run installations, Microsoft provides guidance for reverting to an earlier build. Check the instructions for your installation and consult your administrator if updates are centrally managed.
What format should I use for a workbook containing VBA?
Use File > Save As and select Excel Macro-Enabled Workbook (.xlsm) so the workbook can retain its VBA code.
Will WPS Office fix an Excel VBA crash?
No. WPS Office is an alternative spreadsheet application, not a repair for Microsoft Excel. Test any VBA-dependent workbook and refresh workflow separately before relying on it in WPS.




