Skip to content

VBA118 — Wend without While

Severity: 🔴 error Category: syntax Phase: 1.5

Description

A Wend appears with no While block open in scope.

Failing example

    x = x + 1
Wend

Compliant example

While x < 10
    x = x + 1
Wend

How to fix

Remove the stray Wend or add the opening While.


Source: src/rules.py — entry VBA118.