Name of currently running Sub/Function?

C

CyberDwarf

Hi,



Here's a weird one!

Is there a known way to determine the name of the currently running Sub or
Function in VBA code?

I'm trying to build a generic error-trapping funtion, to avoid writing
hundreds of

ON ERROR GOTO

blocks, with different parameter values.

I've been looking at ways to use the Windows API with AddressOf, etc, but I
can't see how I can get this to work...



Any hints and suggestions welcomed

TIA



Steve
 
C

CyberDwarf

Hi Rick

Thanks for the info.

My real problem is that I have inherited an app with 3500
subs/functions!!!!!!

Doh!

Ah well

Steve
 
D

Douglas J. Steele

Take a look at MZ Tools (http://www.mztools.com)

This free add-in can automatically insert error handling into each routine,
and it's capable of determining the name of the current sub/function when it
does that.
 

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