View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RyanH RyanH is offline
external usenet poster
 
Posts: 586
Default Return the Line Number where the Error Occured

Is there a way to return the Line Number where an error occured in a module?

I currently have this and I think it would be useful to know the error
location.

Sub TEST()

On Error GoTo ErrorHandler

Const ModuleName As String = "Module1"
Const SubName As String = "TEST"

' my code here
Exit Sub

'*****************
ErrorHandler:
Call ErrorHandler(ModuleName, SubName, "Error Line Location Here")

End Sub
--
Cheers,
Ryan