Pivot Table Issues

Troubleshoot Excel Crashes When a VBA Macro Refreshes PivotTables

Nimra MalikNimra Malik Nov 20, 2026 869 views

Question details

Determine why Excel crashes when a VBA macro refreshes PivotTables after an Office update.

Troubleshoot Excel Crashes When a VBA Macro Refreshes PivotTables
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.
Before you start

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.

Solution 1Recommended

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.

1
Create a test workbook

Select File > New > Blank workbook, add representative source data, and use Insert > PivotTable to create a test PivotTable.

2
Add the macro

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.

3
Save and run the test

Use File > Save As to save the test as an Excel Macro-Enabled Workbook (.xlsm), then run the macro from Developer > Macros.

4
Compare the results

If the test workbook also crashes, investigate the Office build. If only the original workbook crashes, test its contents in a new workbook.

Test the PivotTable refresh macro in a new workbook
Free Microsoft Office alternative

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.

Open and work with PivotTable spreadsheets in WPS SpreadsheetsCompatible with common Microsoft Excel formats, including XLSX and XLSFamiliar spreadsheet interface that makes everyday editing easyFree and lightweight for a straightforward move from Microsoft Office
microsoft office alternative - wps office

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.