ERROR[(errornumber)]

(Err.Raise) Generates an error.


errornumber(Optional) The error number you want to generate (Integer).

REMARKS
* Err.Raise was added to replace this statement.
* You can use the ERROR function to return the error message corresponding to a given error number.
* This statement cannot be prefixed with "VBA."
* For the Microsoft documentation refer to docs.microsoft.com

Error 6  'generates Overflow  
Error 11 'generates Division by zero
Error 55 'generates File already open

Call Error(6) 'does not work !!

On Error GoTo ErrorHandler
   Error 55
   Exit Sub
ErrorHandler:
   MsgBox(Err.Number & " - " & Err.Description)

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