Tracing Path of Subroutines in Excel

richlocus
2StarLounger
Posts: 154
Joined: 03 Oct 2015, 00:30

Tracing Path of Subroutines in Excel

Post by richlocus »

Hello:

In previous projects using a different language other than VBA, I was able to trace the path through all subroutines and functions so I can see exactly what is executed in what order. The command was "Ready Trace", and when finished, it was "Reset Trace". It would list in chronological order each sub and function name. This capability would be extremely useful in tracing the path through Excel and Access code.

I did not see a mechanism that would provide the subroutine and function names that were executed and in what order.

Does that exist in Excel or Access VBA?

Thanks,
Rich Locus

User avatar
HansV
Administrator
Posts: 78378
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Tracing Path of Subroutines in Excel

Post by HansV »

The Visual Basic Editor has a Call Stack command. You can issue this when code execution is paused, either because you single-step through the code, or you inserted a Stop command in the code, or you clicked Debug in an error message.

To view the call stack, select View > Call Stack or press Ctrl+L.

S0277.png

Selecting a procedure or function and clicking the Show button places an indicator in the code of that procedure or function that shows where the call was made.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

richlocus
2StarLounger
Posts: 154
Joined: 03 Oct 2015, 00:30

Re: Tracing Path of Subroutines in Excel

Post by richlocus »

Thank You Hans!!