'Loop' must be preceded by a matching 'Do'

A Loop statement occurs without a corresponding Do statement. Loop must be preceded by a corresponding Do statement.

Error ID: BC30091

To correct this error

  1. If this Do loop is part of a set of nested Do loops, make sure each loop is properly terminated.

  2. Verify that other control structures within the Do loop are correctly terminated.

  3. Ensure that this Do loop is correctly formatted.

See Also

Reference

Do...Loop Statement (Visual Basic)