Fix an Excel VBA Macro That Stopped Working After Upgrading to Windows 11
Question details
The user needs to troubleshoot an Excel VBA macro that stopped running after a Windows upgrade.

- Product
- Microsoft Excel
- Device & OS
- Windows 11
- Scenario
- The user is trying to run or debug an existing Excel VBA macro after upgrading from Windows 10.
- Observed behavior
- The macro no longer runs or appears to respond when F5 is pressed in the VBA editor.
Confirm that the workbook is a macro-enabled file, such as an .xlsm file, and that you trust its source. Note any security warning or VBA error displayed when you open the workbook or run the macro.
Check Excel Macro Security and Workbook Trust
Use this solution if Excel blocks the macro or shows a security warning when the workbook opens.
In Excel, open File > Options > Trust Center > Trust Center Settings > Macro Settings. Review the current setting and use a notification-based option if available, rather than enabling all macros.
Close and reopen the workbook. If Excel displays a security warning, select Enable Content only if you trust the file and its macros.
If the workbook came from the internet or an email attachment, close Excel and right-click the file in File Explorer. Select Properties, look for an Unblock checkbox on the General tab, select it if present, and click Apply.
Save the workbook in a trusted local folder. In Excel, review or add that folder under File > Options > Trust Center > Trust Center Settings > Trusted Locations, then reopen the workbook and test the macro.
If the VBA project is digitally signed, check the publisher and signature details in the security warning. If the file opens in Protected View, review its source before selecting Enable Editing; do not disable Protected View globally just to test the macro.

Compile and Step Through the VBA Macro
Use the VBA editor to distinguish a security issue from a code error or a problem with the selected procedure.
Work With Excel Files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for opening and editing spreadsheets. Its support for common Microsoft Office formats helps you move existing files into your workflow, though it does not fix Excel's VBA security or debugging settings.

Frequently Asked Questions
Why does F5 not step through my Excel macro?
In the VBA editor, F5 runs or continues a procedure. Click inside the procedure and press F8 to step through it one statement at a time.
Where can I find Excel's macro security settings?
Open File > Options > Trust Center > Trust Center Settings > Macro Settings. Review the setting and enable content only for workbooks you trust.
How do I unblock a downloaded workbook?
Close the workbook, right-click it in File Explorer, and select Properties. On the General tab, select Unblock if it is available, then click Apply. Only unblock a file from a trusted source.
Could a 64-bit version of Excel affect my VBA code?
Yes. Macros that call Windows APIs may need declarations compatible with 64-bit Excel. Check your version under File > Account > About Excel, then compile the project using Debug > Compile VBAProject in the VBA editor.
Should I disable Protected View to run the macro?
Do not disable Protected View globally just to run a macro. If you trust the file and its source, review the warning and select Enable Editing for that file, then follow any macro security prompt.




