Fix Excel VBA Crashes When Assigning Cell Values
Question details
Identify why Excel crashes silently when VBA assigns values to cells.

- Product
- Microsoft Excel 2016 or later
- Device & OS
- not provided
- Scenario
- A user runs a VBA macro that assigns values to worksheet cells.
- Observed behavior
- Excel crashes during a cell assignment without displaying an error message.
Identify the macro and worksheet involved, and note where the crash occurs. Only enable and run VBA code from a trusted source.
Test the VBA code in a new workbook
Use a new workbook to check whether damage in the original file is contributing to the crash.
In Excel, select File > New > Blank workbook.
Copy the relevant cell ranges from the original file and paste them into the new workbook. Do not copy or move the entire worksheet.
Open the VBA editor and copy the relevant code into corresponding modules, worksheet objects, and ThisWorkbook in the new file. Rename the new sheet if the code refers to its original name.
Select File > Save As and choose Excel Macro-Enabled Workbook (.xlsm). Close Excel, reopen the new file, and run the trusted macro again.
If the new workbook works, rebuild the original file using undamaged content, adding other required data and code gradually and testing as you go.

Test Excel in Safe Mode and check add-ins
Use this check in Excel for Windows to see whether an add-in is involved.
Work with Excel files in WPS Spreadsheet
WPS Office is a free, lightweight Office alternative with a familiar interface for opening and editing spreadsheets. Its Excel format compatibility can help you move everyday spreadsheet work to WPS, although it does not fix an Excel VBA crash.

Frequently Asked Questions
Why should I copy cells instead of the whole worksheet?
Copying cell ranges into a new sheet helps avoid carrying over worksheet-level damage. Use File > New to create a blank workbook, then copy the relevant ranges rather than moving or copying the sheet.
How do I start Excel in Safe Mode?
On Windows, close Excel, hold Ctrl while opening it, and confirm the Safe Mode prompt. Then open the workbook and test the trusted macro.
Where can I disable Excel add-ins?
In Excel for Windows, go to File > Options > Add-ins. Choose Excel Add-ins or COM Add-ins from the Manage list, select Go, and clear the add-ins you want to test.
What format should I use for the new test workbook?
Use File > Save As and select Excel Macro-Enabled Workbook (.xlsm) so the workbook can retain its VBA code.
Does a successful test in a new workbook prove the original is damaged?
It suggests the original workbook may be damaged, but it is not conclusive. Check whether the new workbook also has the named ranges, references, and other components the macro uses.




