
Error Handler -- Getting Line Number of error
There is not a way, though In the past I have seen utilities that will do it
for you. I just haven't used one. You should do a web search at
groups.google.com to see what you mind find.
The truth is Microsoft would have loved to drop it, but they need it for
backward compatibility.
--
Chris Kunicki
www.OfficeZealot.com
Quote:
> Hi Chris,
> Thanks for the reply.
> OK this sounds great!
> Now, is there a way in the VBA editor to autonumber?
> 'Cause we all know that nobody is going to manually type line numbers!
> Come on Microsoft! This is basic stuff!!!!
> --
> Best Regards,
> jmu
> J. M. Underwood
> Apollo Information Systems, Inc.
> Houston, TX
> > Jim, you need to use the Erl Function. Sample:
> > Sub TestError()
> > 101 On Error GoTo ERR_Handler
> > 102 Err.Raise "100"
> > 103
> > 104 Finally:
> > 105 Exit Sub
> > 106 ERR_Handler:
> > 107 Debug.Print Erl
> > End Sub
> > The key is you have to line number the code.
> > --
> > Chris Kunicki
> > www.OfficeZealot.com
> > Hi All,
> > I'd like to design a VBA error handler based on where an error occurs,
and
> > take appropriate action. In some languages there is a function to
return
> > the actual line number where the error occurred, and also the source
code
> > statement that caused the error.
> > Is this possible in VBA? If so, can anyone give me some guidance or
> direct
> > me to a source that will show how to do this?
> > If not, please direct me to some sources for developing good VBA error
> > handlers.
> > TIA.
> > Best Regards,
> > jmu
> > J. M. Underwood
> > Apollo Information Systems, Inc.
> > Houston, TX