Call Stack Available ?

N

Neal Zimm

When browsing the Locals Window, I happened upon the call stack display.

I looked in Help but could not find a way to access it with VBA.
It might be handy in error processing in knowing how you got somewhere.

If it's available, how do you access it?
Thanks.
 
C

Charles Williams

There is no way of accessing the call stack from VBA.

For widely distributed addins I maintain my own global VBA stack array
by adding the name of the function/sub into an array at the start and
subtracting it at the end. Then the error handling can display where
the error has occurred.
I also use line numbers and ERL to display the line the error occurred
on.

regards
Charles
 
B

Bob Phillips

I maintain a stack array too, I am glad to see that I am not the only
oddball. I even call my routines PushProcedureStack and PopProcedureStack :)

Bob
 
N

Neal Zimm

Thanks Charles,
I was afraid of that. I was thinking about the method you mentioned.

I'm not clear on "scope" issues with addins re: global public variables.

I have an addin which opens by reference when the user's wbk is opened.

There are LOTS of public vars in the addin(all have constants or the
values are not changed) by the user.

What happens when 2+ users at the same time use your array? I've read you
have to be careful with globals when there is > 1 user.

Thanks.
 
N

Neal Zimm

Hi Bob, Thanks for the post.
We emailed each other some time ago, I'm the guy who's working on a
newspaper App. (Still working on it, had to take some time off to earn some
money) and I've not forgotten about you.

You gave me your email address. What's the best to contact you if your
email has changed? thanks. (It was about a year ago ?)
 
B

Bob Phillips

Hi Neal,

Which email do you have for me (please obfuscate it, don't publish it so
that it can be sniffed out)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top