PDA

Click to See Complete Forum and Search --> : Getting Function/Sub Name


anis_b
Feb 12th, 2004, 02:30 AM
Is there any way by which we can find out the name of the current Sub or Function that is executing ? I require this for error logging. I want to log in which Sub or Function did the error occured. And donot want to hardcode the name of the same everytime.

crptcblade
Feb 12th, 2004, 07:32 AM
Reflection.MethodBase.GetCurrentMethod.Name

That should work.

alex_read
Feb 12th, 2004, 10:23 AM
Don't suppose you know how to modify that one to grab the name of the current IDE procedure if you want to use this in a vs.net macro by any chance?

crptcblade
Feb 12th, 2004, 12:07 PM
Nope, haven't done anything with macros so far.