Sdílet prostřednictvím


Debugging Macros

When errors occur in your macros, you can debug the code in the Macros IDE by setting breakpoints, watch variables, and so forth. For details about debugging, see Debugging in Visual Studio.

To catch runtime errors in the Macros IDE, and to be able to navigate to lines that contain errors, you must either run with debugging enabled, which requires starting the macro by pressing F5, or by choosing Start on the Debug menu. If you start the macro using CTRL+F5 or by choosing Start Without Debugging on the Debug menu, runtime errors will be ignored.

Whether or not debugging is enabled depends on how a macro is executed:

  • If you click inside of a macro and press F5, or choose Start on the Debug menu, the macro is run with debugging enabled.

  • If you click inside of a macro and press CTRL+F5, or choose Start Without Debugging on the Debug menu, the macro is run without debugging enabled.

  • If the insertion point is not inside of a macro and you press F5, or choose Start on the Debug menu, the Macros IDE goes into Run mode with debugging enabled.

If you set a breakpoint anywhere in your macro code, then debugging is automatically enabled.

You can prevent startup events in a macro from triggering if you press and hold the SHIFT key while starting Visual Studio.

Poznámka

VS Macros do not currently support Windows Forms.

See Also

Concepts

Automating Repetitive Actions by Using Macros

Macros Security and Sharing Issues