12-29-2009, 03:18 AM
You can use the Err object in an if/case statement to handle error.
I created a class to handle error and enhanced the class with a DLL written in .NET to store to eventlog, file, or database. You don't need .NET for file or database, I just prefer the eventlog and could write it easily in .NET. To use the class just replace the case statement with a sub call and pass the err object.
Code:
on error resume next
z = 1/0
select case err.number
case -21345896 'please look up the correct error number
msgbox err.description & ": you divided by zero"
case else
msgbox err.description
end select
I created a class to handle error and enhanced the class with a DLL written in .NET to store to eventlog, file, or database. You don't need .NET for file or database, I just prefer the eventlog and could write it easily in .NET. To use the class just replace the case statement with a sub call and pass the err object.