It seems there may be native errors in the region you're using, in which case you are overlapping native numbers. See
https://exceldevelopmentplatform.blo...criptions.html
Update: I guess these are Windows errors, not Excel errors. So this might not affect VBA programming.Quote:
'Private Const ERROR_CANTOPEN As Long = 1011 ' The configuration registry key could not be opened.
'Private Const ERROR_SERVICE_REQUEST_TIMEOUT As Long = 1053 ' The service did not respond to the start or control request in a timely fashion.'Private Const ERROR_INVALID_PIXEL_FORMAT As Long = 2000 ' The pixel format is invalid.
'Private Const ERROR_BAD_DRIVER As Long = 2001 ' The specified driver is invalid.
'Private Const ERROR_INVALID_WINDOW_STYLE As Long = 2002 ' The window style or class attribute is invalid for this operation.
Iac, the solution i offered above allows to use native numbers without conflict.
Does this mean your example is a handler that you do, or don't like?
I suggest that severity is a different kind of information than type, and shouldn't share the same enum as you have:
Quote:
Code:Public Enum errCustomNumbers
errUserCanceled = 1011
errClickedPause = 1053
errBad = 2000
errVeryBad = 2001
errReallyBad = 2002
End Enum