Consulting

Results 1 to 4 of 4

Thread: Excel VBA Error Report

  1. #1
    VBAX Tutor
    Joined
    Mar 2010
    Posts
    287
    Location

    Question Excel VBA Error Report

    I have googled for a solution but cannot locate one.

    I have macros running on machines that I do not have physical access to. When errors occur, I have to go to the machine to reproduce the issue and then investigate.

    I would like to put together some VBA that will run on the local machines whenever the workbook is opened - recording all Debug and Error (trapped and untrapped) into a CSV file in a default file location e.g. C:\Windows\Errors.txt (or .csv)

    People can then send me the error log and I can have a look and see what is going on...

    Would also like it (if possible) to dump all variables and constants and their values at the end of this file if a full untrapped error occurs i.e. an End / Debug msgbox appears to the user

    Any help appreciated ?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You should NEVER get an End/Debug because you should have full and proper error handling. Your error handler could then dump the info you want.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Mar 2010
    Posts
    287
    Location
    What is the most efficient / user friendly ErrHandler code available? There is normally a well written solution to trap and handle all errors, report them to a file, add to a list box, print in immediate window etc... ?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    The important thing is to trap them. What you do with them depends upomn the application, but the minimal you should do is to put out a MsgBox so that the user knows something has happened.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •