SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 241 | Next

Jim DeMarco

"Pro Excel 2007 VBA"

The Step Out command moves you out of the current procedure and to
the next line of code in the procedure that called the current procedure.
8. Press Ctrl+Shift+F8 to move the execution point back into the TestLoop function at the
end of the loop structure, as shown in Figure 7-20.
Figure 7-20. Result of Step Out command
9. Press F8 two times. The execution point should be back on the call to ExternalProcess,
as shown in Figure 7-21.
If you don??™t have a need to step through this external procedure and want to skip over this
call, you can use the Step Over command.
10. Choose Debug ?¤ Step Over or press Shift+F8.
11. The execution point moves to the bottom of the loop without stepping through the
procedure call, as shown in Figure 7-22.
CHAPTER 7 n DEBUGGING AND ERROR HANDLING 265
Figure 7-21. Execution point on a procedure call
Figure 7-22. The execution point moves directly to the next line of code when the
Step Over command is used.
What if you decide that you should have stepped into the procedure you just stepped
over? (In a loop like this, you may need to test that procedure with the current counter variable
in place.) The VBE gives us a command called Set Next Statement that makes this very
easy to do.
To bring the execution point back to the call to ExternalProcess, do the following:
12. Put the cursor on the line of the next statement that you want executed (in this case,
the call to ExternalProcess).
13. Choose Debug ?¤ Set Next Statement or press Ctrl+F9.


Pages:
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253