On Error Resume Next

On Error Resume Next is a special variant of the On Error statement. You use this statement, instead of On Error Goto, when you want to defer error trapping. When an error occurs and On Error Resume Next is in effect, VBA makes note of the error, but does not do anything about it—execution simply continues with the next statement. You are not ignoring the error, but simply deferring the handling of it. On Error Resume Next is most useful when your program is accessing objects, such as automation objects, because all of the information you need to handle the error may not be available at the very instant the error occurs.

The way to use On Error Resume Next is as follows: When working with objects, identify the locations in ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.