Err Object
SyntaxGroupErr
Error HandlingDescription
Set Err to zero to clear the last error event. Err in an expression returns the last error code. Add vbObjectError to your error number in ActiveX Automation objects. Use Err.Raise or Error to trigger an error event.Err[.Number]This is the error code for the last error event. Set it to zero (or use Err.Clear) to clear the last error condition. Use Error or Err.Raise to trigger an error event. This is the default property.Err.DescriptionThis string is the description of the last error event.Err.SourceThis string is the error source file name of the last error event.Err.HelpFileThis string is the help file name of the last error event.Err.HelpContextThis number is the help context id of the last error event.Err.ClearClear the last error event.Err.Raise [Number:=]errorcode _ [, [Source:=]source] _ [, [Description:=]errordesc] _ [, [HelpFile:=]helpfile] _ [, [HelpContext:=]context]Raise an error event.Err.LastDLLErrorReturns the error code for the last DLL call (see Declare).
Sub Main On Error GoTo Problem Err = 1 ' set to error #1 (handler not triggered) Exit Sub Problem: ' error handler Error Err ' halt macro with message End Sub