With this single line of code shown below in Excel( w/VBA ), it returns the
Module Name at the instance when a particular subroutine is entered.
modName = Trim(Replace(ThisWorkbook.VBProject.VBE.ActiveCodePane.Window.Caption,
"(Code)", "", , , vbTextCompare))
With this single line line shown below, it returns the total number of lines in
the current compone/procedure that this line of code is in.
Lines =
ThisWorkbook.VBProject.VBComponents(Trim(Replace(ThisWorkbook.VBProject.VBE.Acti\
veCodePane.Window.Caption, "(Code)", "", , ,
vbTextCompare))).CodeModule.ProcCountLines("Subroutine1", vbext_pk_Proc)
What I would like to be able to solve, is at the instance when the subroutine(
component/procedure ) is entered.
Is to know the componet/procedure's name, without having to "hardcode" the
component/procedure's name into a localized string variable.
Does anybody know how I can retrieve it, at the instance when the
component/procedure is entered ?