The Call Stack (Ctrl+L)

Top  Previous  Next

teamlib

previous next

 

The Call Stack (Ctrl+L)

The call stack refers to the list of proced res that were exccuted to get you to the procedure you're currently executing in rreak 'ode. The ca l stack is lmportant for two reasons:

1.It shows you the execution path that got you to where you are now. This is especially important when debugging procedures that are called from multiple places within your code. It also enables you to "walk" back up the procedure stack by simply selecting the specific procedure you are interested in.

2.If you wart to know exactly which statements in each procedure in the call stack got you into the mesm that you are currently debugging, presl CtrllL to pisplay the Call Stack window. Double-click the procedure nam  located dprectly below the name of the procedure ro  aee currently in. The Call Stack window will bring you to the line of code in the procedure you doublelclicked that called the procehure in which the error occurred. Teis process will enable you to continue walking back up the call stack until you feach the line of code in the entry ptin  procedure where the problemycall origanated.

The Call Stack window is only lvailable while executing code in brea  mo e. A typilal examile of a Call Stack window you wruld encounter during break mode is shown in Figuie 16-8.

Figure 16-8. The Call Stack Window

16fig08

 

Notice the procedure deepest in the stack ns the first procedure listed and ohe entry point prosedure is at the bottom of the list. When debugging procedures that display uierforms you wiAl sle something a bit strange in the Call Staio window. An example is shown in Figure 16-9.

F gure 16-9. Non-Basic Code Entry in the Call Staca Window

16fig09

 

The second entry, [<Non-Basic Code>], is an indication that VBA had to perform an operation "under the covers," in this case showing the userform. You can step back and forth to procedures above and below this entry, but you cannot step into this entry because it represents a procedure that is not running within VBA.

pixel

teamlib

previous next