| < Free Open Study > |
|
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.
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
Sub MyNewMacro() MessageBox.Show("Good morning Les.") End Sub
| < Free Open Study > |
|