249
C H A P T E R 7
Figure 7-1. The Debug menu
Figure 7-2. The Debug toolbar
Table 7-1 describes the commands on the Debug menu and shows the corresponding
Debug toolbar button for that command when one is available. Table 7-2 describes the
remaining commands on the Debug toolbar.
CHAPTER 7 n DEBUGGING AND ERROR HANDLING 250
Table 7-1. Descriptions of the Debug Menu and Toolbar Commands
Debug Toolbar Button
(If Applicable) Command Shortcut Key Description
??” Compile VBA Project ??” Compiles the project. It does not
create an executable or
redistributable component, but it
does check that the syntax is correct.
Step Into F8 Executes code one statement at a
time. The next statement displayed is
the next statement in the current
procedure (break mode does not
flow into the called procedure or
function).
Step Out Ctrl+Shift+F8 Executes the remaining lines of a
procedure or function from where
the current execution point lies.
??” Run to Cursor Ctrl+F8 Executes code from the current
location to the statement at the
cursor location. This is useful when
there??™s a need to avoid stepping
through large loops.
Debug Toolbar Button
(If Applicable) Command Shortcut Key Description
??” Add Watch ??” Displays the Add Watch dialog box,
where you enter a watch expression
(a user-defined expression that
enables you to see the contents of a
variable or the result of an
expression). The expression can be
any valid Visual Basic expression
(e.g., MyVariable = "New York").
Pages:
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240