Skip to content

VBA150 — Ambiguous name detected (duplicate procedure)

Severity: 🔴 error Category: declaration Phase: 2.12

Description

Two procedures share the same name in one module. Property Get/Let/Set may share a name, but two of the same accessor kind (or two Subs/Functions) may not.

Failing example

Sub Foo()
End Sub
Sub Foo()
End Sub

Compliant example

Sub Foo()
End Sub
Sub Bar()
End Sub

How to fix

Rename or remove the duplicate procedure.


Source: src/rules.py — entry VBA150.