CVERR(errornumber)

Returns a specific type of error (Variant).


errornumberThe error number.

REMARKS
* This function can be used to create user defined errors in your procedures.
* This function can be used to return an error from a user defined function.
* If "errornumber" < 0, then a run-time error is displayed.
* If "errornumber" is not a number, then a run-time error is displayed.
* The implicit conversion of an error is not allowed.
* This function always returns a variant whose value has been converted to an Error Subtype.
* There does not actually exist an error data type although it is possible to have a Variant data type whose subtype is Error.
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print CVErr(6) ' Error 6  
Debug.Print CVErr(11) ' Error 11
Debug.Print CVErr(55) ' Error 55
Debug.Print CInt(CVErr(2000)) ' 2000
Debug.Print CVErr(-100) ' generates an Invalid Procedure Call or Argument run-time error
Debug.Print CVErr("some text") ' generates a Type Mismatch run time error

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top