VBA & Macro Problems

How to Fix Excel Crashes or Freezes When Running VBA Macros

Steve KSteve K Oct 29, 2026 871 views

Question details

Excel freezes, slows down, or crashes unexpectedly when running VBA macros repeatedly.

How to Fix Excel Crashes or Freezes When Running VBA Macros
Product
Microsoft Excel
Device & OS
not provided
Scenario
Executing VBA macros in a workbook, particularly when the macro is run frequently or repeatedly.
Observed behavior
The Excel application becomes unresponsive, freezes indefinitely, or abruptly closes without saving, interrupting the user's workflow.
Before you start

Ensure you have backed up your Excel files and VBA code before beginning. Some troubleshooting steps involve running Excel in Safe Mode or modifying system files, so keeping your work secure is essential.

Solution 1Recommended

Restore the Personal Macro Workbook to a Previous Version

A sudden corruption in the Personal Macro Workbook (PERSONAL.XLSB) is a common cause for Excel crashing during macro execution. Restoring it to a previously working state can quickly resolve the issue.

Your Personal Macro Workbook loads every time you start Excel. If this file gets damaged or saved with corrupted data, it will cause macros to fail or Excel to crash entirely.

1
Locate the XLSTART Folder

Press the Windows Key + R to open the Run dialog. Type `%appdata%\Microsoft\Excel\XLSTART` and press Enter to open the folder where your Personal Macro Workbook is stored.

2
Check Previous Versions

Right-click the `PERSONAL.XLSB` file and select 'Properties'. Navigate to the 'Previous Versions' tab in the properties window.

3
Restore the File

Select a version of the file from a date before the crashes started occurring, and click 'Restore'. Restart Excel and test your macros.

Restore the Personal Macro Workbook to a Previous Version
Backup Recommended: Once your macros are working again, consider making a manual copy of your PERSONAL.XLSB file in a separate folder as a backup.
Free Microsoft Office alternative

Switch to WPS Office for a Stable Spreadsheet Experience

If Microsoft Excel continues to crash or freeze while running operations, consider using WPS Office. It provides a lightweight, resource-friendly environment with robust compatibility for Excel formats, helping you avoid system freezes.

Free and lightweight alternative to Microsoft OfficeHigh compatibility with Microsoft Excel formats (.xlsx, .xls, .xlsm, .csv)Familiar tabbed interface for seamless migration with no learning curveOptimized performance to prevent freezing on large datasets
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Excel macro work once but freeze the second time?

This often happens if the macro does not properly release system memory or objects after its first run, or if global variables are retaining incorrect data. Check your VBA code for proper object clearing (e.g., using `Set MyObject = Nothing`) at the end of the script.

How can I fix broken VBA references causing Excel to crash?

Open Excel, press ALT + F11 to open the VBA Editor, and click Tools > References. Look for any checked items that start with 'MISSING:'. Uncheck them, click OK, and save your workbook to resolve the broken reference.

Does disabling screen updating help prevent Excel from freezing?

Yes. Adding `Application.ScreenUpdating = False` at the beginning of your macro and setting it back to `True` at the end stops Excel from redrawing the screen during execution. This drastically reduces memory usage and processing time, which can prevent freezing.