'Exit' must be followed by 'Sub', 'Function', 'Property', 'Do', 'For', 'While', 'Select', or 'Try'

An Exit statement contains an invalid keyword. Exit must specify the block from which control is to be transferred to the statement following the block; for example, End While.

Error ID: BC30240

To correct this error

  • Add a valid keyword following Exit, or remove the Exit statement.

See Also

Reference

Exit Statement (Visual Basic)