'On Error' statements are not valid within 'Using' statements

An On Error statement appears within a Using statement but is not valid in that context.

Error ID: BC36013

To correct this error

  • Use structured error handling, such as a Try…Catch block, in place of the On Error statement.

See Also

Tasks

How to: Test Code with a Try…Catch Block in Visual Basic

Concepts

Structured Exception Handling Overview for Visual Basic

Choosing When to Use Structured and Unstructured Exception Handling

Reference

On Error Statement (Visual Basic)

Try...Catch...Finally Statement (Visual Basic)