Err.Raise for all the handled errors #20
6DiegoDiego9
started this conversation in
General
Replies: 1 comment
-
@6DiegoDiego9, if you're interested in designing/writing the error handling functionality for this code (or any other accepted coding style) then you are very welcome to. For me this is a collaboration (of which I borrowed much from previous collaborations) and after I publish the Add-in version, I will probably be approaching a point of diminishing contribution given my background, skills, and interest. So go at it! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I saw that you used many times the very basic Msgbox+End combo for your handled errors.
For example:
I'd suggest to use the proper VBA instruction:
Advantages:
Note: 76 is just the native error number that I found in the VBA Error Codes list for "path not found" errors but it's not important. You can use any number, even always 1 for faster (lazy) coding, because as long as you specify a Description it overrides the native description.
My personal preference is to generally always use the number 1 for all the errors internal to the code (bug in code) and 2 for all the errors external to the code (user's fault), usually with explicit custom descriptions. Depending on this number, my global error handler uses a different graphical and textual template (eg header) for displaying the error.
Beta Was this translation helpful? Give feedback.
All reactions