Line Numbers

  • Thread starter Thread starter George Hester
  • Start date Start date
G

George Hester

In my code I have set up various error catching routines. When I get the errors I see the description and the module where the error occurs. But I would like to obtain the line number of where the error occurs. I looked at this article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;184742&Product=vb6

The code I have is just in Modules. No forms. I tried to use this but was unsuccessful. Is there some way to set up a error catching routine so that the line number of where the error occurs can be sent to a message box or the debug window?

Outlook 2002 in Windows 2000 SP4. Thanks.
 
Public Sub i22()
10 Dim v As String
20 Dim w As Integer
30 v = "four"
40 w = 1
50 'w = w + v
60 On Error Resume Next
70 VBA.Err.Raise (20)
80 MsgBox Err.Description
90 MsgBox VBA.Erl
End Sub

This gives "line 70" where the error occurs.

"Advanced Visual Basic" -The Mandelbrot Set pg 11

--
George Hester
__________________________________
In my code I have set up various error catching routines. When I get the errors I see the description and the module where the error occurs. But I would like to obtain the line number of where the error occurs. I looked at this article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;184742&Product=vb6

The code I have is just in Modules. No forms. I tried to use this but was unsuccessful. Is there some way to set up a error catching routine so that the line number of where the error occurs can be sent to a message box or the debug window?

Outlook 2002 in Windows 2000 SP4. Thanks.
 
Back
Top