Debugging Macros

 < Free Open Study > 



The Macros IDE

Once you record a macro, you will probably want to edit the macro's code to add, change, or delete functionality. You may want to manually create your own macro rather than record one. If you write a complex macro, you will undoubtedly need to debug the macro. The Macros IDE is the tool that allows you to accomplish these tasks. The Macros IDE appears and functions very much like the regular IDE. If you right-click a module or a macro command in the Macro Explorer and select the Edit option, the Macros IDE will open as a separate window on top of the regular IDE.

For example, if you right-click the CommentVBCode macro command in Module1 of MyMacros and select the Edit option, the Macros IDE will be displayed as shown in Figure 8-9.

click to expand
Figure 8-9: The Macros IDE

In some cases, you might want to manually create a macro rather than record one. In the Macro Explorer, right-click Module1 and choose New Macro Command. Insert the code shown in Listing 8-5. Press Ctrl-S to save your macro. You can now run the macro as you would any other macro.

Listing 8-5: Manually Created Macro

start example
 Sub MyNewMacro()    MessageBox.Show("Good morning Les.") End Sub 
end example



 < Free Open Study > 



Writing Add-Ins for Visual Studio  .NET
Writing Add-Ins for Visual Studio .NET
ISBN: 1590590260
EAN: 2147483647
Year: 2002
Pages: 172
Authors: Les Smith

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net