Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: "Can't Execute Code in Break Mode" When Running Macro


View products that this article applies to.

Symptoms

When you attempt to run a macro from the Macro dialog box, from within the Visual Basic Editor, or by pressing the macro's shortcut key, you receive the following error message:
Can't execute code in break mode.
In addition, when you attempt to click the Macros command on the Macro submenu of the Tools menu, nothing happens. You cannot click the Macros command and display the Macro dialog box.

You may also notice that the Record New Macro command on the Macros submenu of the Tools menu is not available (appears dimmed).

↑ Back to the top


Cause

This behavior occurs when you attempt to run a macro and another macro is in break mode. For example, this can occur if you have added a breakpoint to a macro by selecting a line of code and pressing F9, or by adding the following line of code to the macro:
Stop
				

↑ Back to the top


Resolution

Exit break mode. To do this, switch to the Visual Basic editor and use any of the following methods:
  • Click the Reset button on the Standard toolbar. (This option halts the macro.)
  • Click the Continue button on the Standard toolbar. (This option finishes running the macro.)
  • Press F5. (This option finishes running the macro.)

↑ Back to the top


Keywords: KB213672, kbprb, kberrmsg

↑ Back to the top

Article Info
Article ID : 213672
Revision : 5
Created on : 10/11/2006
Published on : 10/11/2006
Exists online : False
Views : 278