This documentation is archived and is not being maintained.

'GoTo <linelabel>' is not valid because '<linelabel>' is inside a 'Using' statement that does not contain this statement

A GoTo statement outside a Using construction attempts to branch to a line label inside the construction.

It is not valid to branch from anywhere outside a Using...End Using construction to anywhere inside the construction.

Error ID: BC36009

To correct this error

  • Change the line label in the GoTo statement to a label that is not inside any For...Next, For Each...Next, SyncLock...End SyncLock, Try...Catch...Finally, With...End With, or Using...End Using construction.

    -or-

  • Remove the GoTo statement entirely. The only way you can enter a Using...End Using construction is to allow control to pass to the Using statement itself.

Show: