VBA & Macro Problems

Fix Excel VBA Crashes When Assigning Cell Values

Camila MilosovichCamila Milosovich Nov 20, 2026 869 views

Question details

Identify why Excel crashes silently when VBA assigns values to cells.

Fix Excel VBA Crashes When Assigning Cell Values
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.
Before you start

Identify the macro and worksheet involved, and note where the crash occurs. Only enable and run VBA code from a trusted source.

Solution 1Recommended

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.

1
Create a workbook

In Excel, select File > New > Blank workbook.

2
Copy the cell contents

Copy the relevant cell ranges from the original file and paste them into the new workbook. Do not copy or move the entire worksheet.

3
Copy the VBA code

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.

4
Save and retest

Select File > Save As and choose Excel Macro-Enabled Workbook (.xlsm). Close Excel, reopen the new file, and run the trusted macro again.

5
Rebuild if needed

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 the VBA code in a new workbook
Check workbook dependencies: The test may also need named ranges, formulas, references, or other workbook components used by the macro. A different result can reflect a missing dependency rather than workbook damage.
Free Microsoft Office alternative

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.

Open and edit common spreadsheet files in a familiar interface.Compatible with Microsoft Excel formats such as XLSX and XLS.Continue working with worksheet data outside Microsoft Excel.Free and lightweight for everyday office tasks.
microsoft office alternative - wps office

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.