Skip to content

VBA111 — Do without Loop

Severity: 🔴 error Category: syntax Phase: 1.5

Description

A Do block has no matching Loop.

Failing example

Do While x < 10
    x = x + 1

Compliant example

Do While x < 10
    x = x + 1
Loop

How to fix

Add the Loop (optionally Loop While/Loop Until) that closes the Do.


Source: src/rules.py — entry VBA111.