VBA181 — Statement invalid inside Type block¶
Severity: 🔴 error Category: placement Phase: 3.7
Description¶
A Type … End Type block may only contain field declarations (Name [(dims)] As Type). Executable statements or Dim/Sub/… declarations inside it are illegal.
Failing example¶
Compliant example¶
How to fix¶
Move the statement outside the Type; keep only Name As Type fields inside.
Source: src/rules.py — entry VBA181.