View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Daniel.C Daniel.C is offline
external usenet poster
 
Posts: 43
Default Return the Line Number where the Error Occured

Manually, unless you use the addin indicated by Bob. As far as I know,
numbering lines has no great use, but certainly, the addin should have other
interesting functionalities.
Daniel
"RyanH" a écrit dans le message de news:
...
how do you number your lines?
--
Cheers,
Ryan


"Daniel.C" wrote:

You can use "erl" if your code lines are numbered :
14 On Error Resume Next
15 Workbooks.Open "NotAvalidOne.xls"
16 MsgBox Erl
--
Regards.
Daniel
"RyanH" a écrit dans le message de
news:
...
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