Search code examples
vbaexcelsubroutine

How to know the procedure by which subroutine called? in excel vba


I sometimes has error on subroutine.The subroutine is called by many procedure. So, I try to find caller procedure for step over.

By the way, user-defined function can know the caller.
It is simply.

MsgBox Application.Caller

We can see dialog and caller cell address.

I want to know caller procedure of subroutine.


Solution

  • You can use Call Stack Dialog Box

    For example in the below image proc3 was called by proc2 which is displayed in call stack dialog box.

    enter image description here