Microsoft Office Tutorials and References
In Depth Information
Weapons of Mass Debugging
The Design Mode button turns Design mode on and off in the active workbook. Design mode is
the time during which no code from the project is currently running. You can leave Design mode by
clicking the Design mode icon again, or by running a macro or using the Immediate window. When
you have an ActiveX object on your worksheet, such as a CommandButton , Design mode allows you
to view the object’s properties, or to double-click the object to quickly access its module in the VBE.
Clicking the Run button will have one of two effects. If your cursor happens to be blinking in the
Code window within a macro, clicking the Run button, or pressing the F5 key, runs the macro.
Otherwise, it will call the Macro dialog box, same as if you were on a worksheet and you pressed
the Alt+F8 keys.
Clicking the Break button is the same as pressing the Ctrl+Break keys, which halts macro execution.
Break mode is a special mode of operation in the Visual Basic Editor that allows you to run one line
of code at a time without having to run the entire macro. Examining one line of code at a time is a
way to pinpoint the exact whereabouts of the error. You can edit code in Break mode.
Clicking the Reset button clears the Call stack and clears the module-level variables. This will end
Break mode, end all program execution, and close the Debug window if it is open.