VBA & Macro Problems

Fix Excel VBA Breakpoints and Workbook_Open Errors After an Office Update

Nimra MalikNimra Malik Nov 12, 2026 869 views

Question details

The user needs to restore normal Excel VBA debugging and prevent a Workbook_Open procedure from stopping unexpectedly after an Office update.

Fix Excel VBA Breakpoints and Workbook_Open Errors After an Office Update
Product
Microsoft Excel VBA in a macro-enabled workbook
Device & OS
not provided
Scenario
A macro-enabled workbook is opened after an Office upgrade, and the user wants Workbook_Open, F9 breakpoints, and Stop statements to work normally.
Observed behavior
The Workbook_Open procedure stops unexpectedly, while F9 breakpoints and the VBA Stop statement no longer behave as expected.
Before you start

Close all other Excel workbooks before testing so no other open project or add-in affects compilation. Open the affected file with macros disabled first to prevent Workbook_Open from running while you inspect the VBA project.

Solution 1Recommended

Recompile the VBA project and reopen the workbook with macros enabled

Use this first when VBA behavior changed immediately after an Office update and the workbook previously worked correctly.

A harmless code edit followed by a full compile can refresh the VBA project state. Compile before reopening the workbook with enabled macros so Excel can identify syntax errors, broken references, or declarations that are no longer compatible.

1
Open the workbook without running macros

In Excel, open the macro-enabled workbook and choose Disable Macros in the security warning. If Workbook_Open runs before you can respond, hold Shift while opening the workbook to suppress automatic open macros.

2
Open the VBA editor

Press Alt+F11, then expand VBAProject in the Project Explorer and open ThisWorkbook.

3
Make a harmless edit

In the Workbook_Open procedure, add and remove a space or a comment, then choose Debug > Compile VBAProject from the VBA editor menu.

4
Resolve compile errors

If Excel highlights code or reports an error, correct the indicated procedure, declaration, or reference, then select Debug > Compile VBAProject again until no compile message appears.

5
Save and retest

Choose File > Save in Excel, close the workbook and Excel, then reopen the file and select Enable Content to test Workbook_Open, F9 breakpoints, and Stop statements.

Recompile the VBA project and reopen the workbook with macros enabled
Compilation completed: If Debug > Compile VBAProject completes without an error, the project has passed the current compile check. Continue with security and reference checks if debugging behavior is still abnormal.
Free Microsoft Office alternative

Use WPS Office for everyday Excel workbook editing and migration

If a Microsoft Office update has disrupted your workflow, WPS Office provides a free, lightweight office suite with a familiar spreadsheet interface for opening, editing, and migrating compatible workbook files. You can move routine spreadsheet work to WPS Office while reviewing Microsoft-specific VBA and add-in dependencies separately.

Free and lightweight spreadsheet tools for everyday workbook editingOpens and saves Microsoft Excel .xls and .xlsx formatsFamiliar ribbon-based interface helps reduce the learning curve after migrationUseful for reviewing workbook content while isolating Microsoft Office VBA update issues
microsoft office alternative - wps office

Frequently Asked Questions

Why does Workbook_Open run when I am trying to repair the VBA project?

Workbook_Open runs when macros are enabled during workbook opening. Open the file and choose Disable Macros, or hold Shift while opening the workbook to suppress automatic open macros during troubleshooting.

Why is Debug > Compile VBAProject unavailable or not helping?

First choose Run > Reset in the VBA editor to end any active code execution. Then check Tools > References for a MISSING: library and compile again after correcting the reference or the highlighted code error.

Why did my F9 breakpoint disappear after compiling VBA code?

Breakpoints are not permanently stored in the workbook and can be cleared after edits, compilation, a VBA reset, or closing Excel. Open the procedure again and press F9 on an executable statement to recreate the breakpoint.

Can an Office update break old VBA API declarations?

Yes. A move to 64-bit Office or changes in dependent libraries can expose older declarations. Check File > Account > About Excel for bitness and update applicable Declare statements with PtrSafe and LongPtr.

How do I know whether macro security is blocking the workbook?

Open File > Options > Trust Center > Trust Center Settings > Macro Settings. Also review Trusted Locations and confirm that the workbook is not marked as blocked by a security policy or opened from an untrusted location.