Visual Basic Scripting Edition  

Expected 'Loop'

You created a Do loop construct, but did not properly terminate the loop. Do loop constructs are terminated with an associated Loop statement. The following demonstrates the correct structure of a Do loop construct.

Do [{While | Until} condition]
   [statements]
   [Exit Do]
   [statements]
Loop 

Or, you can use this syntax:

Do
   [statements]
   [Exit Do]
   [statements]
Loop [{While | Until} condition]

To correct this error

Make sure that the Do loop construct includes all the necessary parts.

See Also

Do...Loop Statement | Exit Statement | For...Next Statement | While...Wend Statement