Skip to content

VBA103 — ReDim target is not a dynamic array

Severity: 🔴 error Category: declaration Phase: 1.4

Description

ReDim requires its target to be declared as a dynamic array (Dim x() As …).

Failing example

Dim x As Long
ReDim x(1 To 10)

Compliant example

Dim x() As Long
ReDim x(1 To 10)

How to fix

Add empty parentheses to the Dim declaration.


Source: src/rules.py — entry VBA103.