Show Contents / Index / Search

Inline Error Handling

To cause a procedure to handle relatively simple runtime errors without branching to a separate error-handling routine, you can use a form of the On Error statement that lets you deal with errors "in line"; that is, directly in the code that caused the error, rather than in a separate routine.

To handle an error inline

  • Use the Resume Next statement with On Error.

    Any errors that occur during runtime cause Reflection 2008 to continue executing the macro at the next statement.

    If an error is determined to have occurred, it is handled by opening a dialog box, passing control to another procedure or to a routine within the same procedure.

Inline Error Example