Get name of funcion when error ocurr...
Hello all!
How to i cam automatic get the original name of a function when an error occurs, and how to i cam handle one global procedure to error treatment?
see this code:
VB Code:
Private Sub MyFunction()
On Error GoTo GlobalErrorTreat:
Dim x As Integer
Dim a As String
Dim r As Boolean
a = "a"
x = 1
r = a * x ' this generate an error
MsgBox r
End Sub
' in a global module or class
On Error GoTo GlobalErrorTreat:
MsgBox "This error ocurr in : " & FunctionName
'how to get FunctionName is my problem...
Resume Next
Thanks!:wave: