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

Exención de responsabilidades de contenido KB retirado

Este artículo se refiere a productos para los que Microsoft ya no ofrece soporte técnico. Por tanto, el presente artículo se ofrece "tal cual" y no será actualizado.

Symptoms

In the versions of Microsoft Excel listed above, if you attempt to run a macro, one or more of the following problems may occur:


  • If you click the Tools menu and point to Macro, one of the following problems may occur if you click the Macros menu item:

    1. Nothing happens; the menu does not disappear, and the Macro dialog box is not displayed. You cannot click the Macros menu item.
    2. The menu disappears, but the Macro dialog box is not displayed.
  • If you attempt to run a macro, either from the Macro dialog box, from within the Visual Basic Editor, or by pressing its shortcut key, you receive the following error message:
    Microsoft Visual Basic
    Can't execute code in break mode

Cause

These problems will occur if, when you attempt to run a macro, another macro is currently in break mode. This may occur if you have added a breakpoint to a macro by selecting a line of code and pressing F9, or if a macro contains the following line of code:
   Stop

Resolution

To exit break mode, activate the Visual Basic Editor by clicking the Tools menu, pointing to Macro, and clicking Visual Basic Editor. Then, either:


  • On the Standard toolbar, click the Reset button. This halts all macro execution. -or-

  • Either click the Continue tool on the Standard toolbar or press F5. The halted macro will continue its execution.

Status

This behavior is by design of the versions of Microsoft Excel listed at the beginning of this article; it is not possible to run a Visual Basic macro when another macro is in break mode.
Propiedades

Id. de artículo: 177828 - Última revisión: 10/10/2006 - Revisión: 1

Comentarios