How to Fix Visual Basic Error 50001 in Word DOTM Templates
Question details
The user needs to resolve an issue where a specific macro-enabled template fails to run and throws a Visual Basic error upon opening.

- Product
- Word for Microsoft 365
- Device & OS
- Mac
- Scenario
- Opening a specific .dotm template containing legacy macros originally used in Word 2011 on a new computer running Microsoft 365.
- Observed behavior
- Word displays Error 50001 and states that the code cannot be operated in break mode, which halts the template's functionality.
Before modifying the macro code, ensure the Developer tab is enabled in your Word ribbon and save a backup copy of your .dotm template.
Exit Break Mode and Remove Stop Statements
Identify and remove breakpoints or 'Stop' commands in the VBA code that force the macro to pause execution and trigger the error.
The 'Cannot execute code in break mode' error typically occurs when the Visual Basic Editor pauses macro execution. This can happen due to an explicit 'Stop' command written in the code, an active breakpoint left by a developer, or an unhandled runtime error.
Launch Word, go to the Developer tab on the ribbon, and click 'Visual Basic' to open the VBA Editor.
In the Project Explorer pane on the left, find the project associated with your specific .dotm template and expand its modules.
Look for any lines of code highlighted in dark red with a red dot in the left margin. Click the red dots to remove these breakpoints.
Use the Find function (Ctrl+F or Cmd+F) to search for the word 'Stop' in the code. Delete these statements if they were used for debugging.
Click the 'Reset' button (the square icon on the standard toolbar) to completely exit break mode, then save the template.

Update Legacy Code for Microsoft 365 Compatibility
Update old macros that worked in Word 2011 to ensure they are compatible with the 64-bit architecture of Microsoft 365 for Mac.
Experience Seamless Document Editing with WPS Office
If legacy macros and Word compatibility issues are slowing you down, WPS Office provides a lightweight, highly compatible, and free alternative. Enjoy a familiar interface that handles complex documents with ease, saving you from constant troubleshooting.
- 1. Download and Install: Get the free WPS Office suite from the official website and follow the simple installation instructions.
- 2. Open Your Documents: Launch WPS Writer and open your existing Word documents to see them perfectly formatted.
- 3. Edit Without Interruptions: Enjoy a stable, fast editing environment without worrying about legacy Office errors.

Frequently Asked Questions
What does 'Cannot execute code in break mode' mean in Word?
This error means that the Visual Basic for Applications (VBA) engine has paused the execution of a macro. This usually happens because a developer set a breakpoint, there is a 'Stop' command in the code, or a runtime error occurred. You must reset the project in the VBA Editor before it can run again.
Why do macros from Word 2011 fail in Microsoft 365 on Mac?
Word 2011 for Mac was a 32-bit application, whereas Microsoft 365 is a modern 64-bit application. Macros written for 2011 often contain 32-bit specific API declarations or legacy AppleScript commands that are no longer supported by macOS sandboxing rules and the 64-bit architecture.
How do I access the VBA Editor in Word for Mac?
To access the VBA Editor, you first need to enable the Developer tab. Go to Word > Preferences > Ribbon & Toolbar, and check the box for 'Developer' in the main tabs list. Once enabled, click the Developer tab on the ribbon and select 'Visual Basic'.




