Click to Rate and Give Feedback

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Studio Automation and Extensibility 
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.

NoteNote

VS Macros do not currently support Windows Forms.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Debugging event handlers      Craig Skibo - MSFT   |   Edit   |   Show History
To debug an event handler, set a breakpoint on the line of code within the event handler where you want execution of the event handler to break. Then, place the editor caret ourside the body of a function, subroutine or event handler, and press F5 to set the Macros editor into debug mode. Perform a task which would cause the event handler to be fired.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker