Call Stack

Posted on 2005-03-20
Medium Priority
Last Modified: 2009-12-16
Is there a way to access the VB call stack at run-time. Basically I want a procedure to be able to determine the name of the procedure that called it
Question by:bisonfur37
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 19

Accepted Solution

Shauli earned 1000 total points
ID: 13587233
I dont think there is a way to simply access call stack after compiling. A simple way (however, dirty) would be to hard code the procedure name. For example, if you need it for error traping then you can do:

Public Sub...

Exit sub

MsgBox Err. Number & "[" & Err.Description & "]" has occured in yourprocedurenamehere"
End Sub


Author Comment

ID: 13587633
I think I answered my own question after some research...  

As Shauli said, there is no easy way to access the callstack at runtime.  Dan Fergus offers a workaround using dgbhelp.dll in his article Get Debug Info From Production App -- http://www.ftponline.com/vsm/2002_05/magazine/columns/blackbelt/default_pf.aspx (requires registration).

Shauli, I'll reward you the points

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month12 days, 21 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question