ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Record line number in macro where error occurs (https://www.excelbanter.com/excel-programming/425514-record-line-number-macro-where-error-occurs.html)

Spike

Record line number in macro where error occurs
 
When trapping errors, is it possible to record the line in the macro where
the error occurred so in the Error Trapping routine one can note this line to
assist in finding the error.

I copy error details to an Error Log so it would be handy to have the line
in the macro where the error trapping routine was triggered.
--
with kind regards

Spike

Jacob Skaria

Record line number in macro where error occurs
 
This post will be helpful.
http://www.fmsinc.com/free/NewTips/V...ineNumber.html

If this post is helpful click Yes
---------------
Jacob Skaria

Spike

Record line number in macro where error occurs
 
Thanks for tha. So we have to number the rows of the macro, which is a shame
as makes it look scrappy but then if that is it so be it.
--
with kind regards

Spike


"Jacob Skaria" wrote:

This post will be helpful.
http://www.fmsinc.com/free/NewTips/V...ineNumber.html

If this post is helpful click Yes
---------------
Jacob Skaria


Bernie Deitrick

Record line number in macro where error occurs
 
Spike,

For development work, in the VBE: Tools / Options "General" tab, check "Break on all errors"

HTH,
Bernie
MS Excel MVP


"Spike" wrote in message
...
When trapping errors, is it possible to record the line in the macro where
the error occurred so in the Error Trapping routine one can note this line to
assist in finding the error.

I copy error details to an Error Log so it would be handy to have the line
in the macro where the error trapping routine was triggered.
--
with kind regards

Spike




Rick Rothstein

Record line number in macro where error occurs
 
Get MZTools... it's free and it's great! One of the many, many things it
does is allow you to add and remove line numbers at will.

http://www.mztools.com/v3/mztools3.aspx

--
Rick (MVP - Excel)


"Spike" wrote in message
...
When trapping errors, is it possible to record the line in the macro where
the error occurred so in the Error Trapping routine one can note this line
to
assist in finding the error.

I copy error details to an Error Log so it would be handy to have the line
in the macro where the error trapping routine was triggered.
--
with kind regards

Spike




All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com