Skip to content

VBA003 — Duplicate declaration

Severity: 🔴 error Category: declaration Phase: 0

Description

Two Dim/Const declarations define the same name in the same scope.

Failing example

Dim x As Long
Dim x As String

Compliant example

Dim x As Long
Dim y As String

How to fix

Rename one of them or remove the duplicate.


Source: src/rules.py — entry VBA003.