How to Fix Excel Crashes or Freezes When Running VBA Macros
Question details
Excel freezes, slows down, or crashes unexpectedly when running VBA macros repeatedly.

- 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.
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.
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.
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.
Right-click the `PERSONAL.XLSB` file and select 'Properties'. Navigate to the 'Previous Versions' tab in the properties window.
Select a version of the file from a date before the crashes started occurring, and click 'Restore'. Restart Excel and test your macros.

Run Excel in Safe Mode and Disable Add-ins
Third-party add-ins or COM add-ins can conflict with VBA execution, causing Excel to freeze. Safe Mode helps identify if an add-in is the culprit.
Perform an Online Repair of Microsoft Office
If Excel's core files or VBA reference libraries are damaged, repairing the Office installation is necessary to restore stability.
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.

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.




