Skip to content

VBA004 — Invalid .member reference without With

Severity: 🔴 error Category: member_access Phase: 0

Description

A leading-dot member reference appears outside any With block.

Failing example

.Value = 1

Compliant example

With r
    .Value = 1
End With

How to fix

Wrap the access in a With block or qualify the receiver explicitly.


Source: src/rules.py — entry VBA004.