Error logging in VBA

HappySpleen

New Member
Joined
Oct 13, 2015
Messages
1
Hello all,

I need to know if it is possible to have error handling that can make and save a time stamped text file that contains all the information that I could need to recreate the error later.

What I need it to do is:
  1. Log what Form, Module or Class Module the error occurred in
  2. What function or Sub the error occurred in
  3. What line of code the error occurred in
  4. What data was being processed at the time (String, long, Range ... ...)
  5. To save the error as a text file saved as the date and time it is created

The reason for trying to log the data that was being processed is I needed to make sure that I was processing the data correctly so any small change can cause it to fail. I have never worked with error handling before so I am a bit lost as to how I would do this and any help is appreciated.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,215,613
Messages
6,125,834
Members
449,266
Latest member
davinroach

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top