Office Apps Crashing

Fix Excel for Microsoft 365 Crashing When Closing a VBA Module Window

Aamir Naveed AkramAamir Naveed Akram Nov 10, 2026 869 views

Question details

Excel for Microsoft 365 repeatedly crashes when attempting to close a Visual Basic for Applications (VBA) module window.

Fix Excel Crashing When Closing a VBA Module Window
Product
Microsoft Excel for Microsoft 365
Device & OS
not provided
Scenario
Editing or reviewing VBA macros in the Visual Basic Editor.
Observed behavior
The Excel application crashes entirely when the user closes a VBA module window, even if no VBA code is actively running at the time.
Before you start

Ensure you save all your active workbooks and close any unnecessary background applications to prevent data loss while troubleshooting this crash.

Solution 1Recommended

Maximize the VBA Module Window Before Closing

A known temporary workaround for this bug is to maximize the module window prior to closing it, which prevents the window state conflict causing the crash.

This specific issue is often tied to a bug in how the Visual Basic Editor handles restored or floating window states.

1
Open the Visual Basic Editor

Press ALT + F11 in Excel to open the VBA editor.

2
Maximize the Window

Click the Maximize button (the square icon) in the top-right corner of the VBA module window.

3
Close the Editor safely

Once maximized, click the 'X' to close the VBA module window or press ALT + Q to return to Excel without crashing.

Maximize the VBA Module Window Before Closing
Quick Fix: Using ALT + Q to close and return to Microsoft Excel bypasses closing the internal module windows individually, often preventing the crash.
Free Microsoft Office alternative

Try WPS Office for Stable Spreadsheet Management

If Excel continues to crash due to unresolved build bugs, consider switching to WPS Office. It provides a lightweight, highly compatible alternative for handling complex spreadsheets without the heavy system crashes.

  1. 1. Download WPS Office: Visit the official WPS website to download and install WPS Office for free.
  2. 2. Open WPS Spreadsheets: Launch the application and select the Spreadsheets module.
  3. 3. Load Your Workbook: Open your macro-enabled files (.xlsm) and enjoy a stable editing experience.
Seamless compatibility with Microsoft Excel formats including .xlsx, .xlsm, and .csv.Lightweight software architecture that significantly reduces system crashes and lag.Familiar user interface for a smooth transition without the need for retraining.Free to download and use with essential spreadsheet features built-in.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel crash only when I close the VBA module?

This is a known bug in specific builds of Microsoft 365 where the Visual Basic Editor fails to correctly release memory or handle window state changes when minimized or restored.

Will I lose my macros if Excel crashes?

If you haven't saved your workbook before the crash, unsaved VBA code changes will be lost. It is highly recommended to frequently press CTRL + S while editing macros.

Does this VBA crash affect all versions of Excel?

This specific crash typically affects recent Microsoft 365 subscription builds. Older standalone versions like Excel 2016 or 2019 might not experience this exact VBA editor bug.

Where can I find the exact Office build number to report to support?

You can find your exact Office build number by opening Excel, clicking on 'File', then 'Account'. The build number is listed under the 'About Excel' section.