Skip to content

VBA010 — Syntax error

Severity: 🔴 error Category: syntax Phase: 0

Description

Generic syntax error (unexpected End X, missing Then, stray block terminator …).

Failing example

If x > 0
    Debug.Print x
End If

Compliant example

If x > 0 Then
    Debug.Print x
End If

How to fix

Check the surrounding tokens — typical causes are missing Then or mismatched block keywords.


Source: src/rules.py — entry VBA010.