Skip to content

VBA105 — Erase target not a variable

Severity: 🔴 error Category: declaration Phase: 1.4

Description

Erase was applied to something other than an array variable.

Failing example

Erase Foo  ' Foo is a Sub

Compliant example

Dim arr() As Long
Erase arr

How to fix

Check that the name refers to an array variable.


Source: src/rules.py — entry VBA105.