Skip to content

VBA152 — Property Get/Let type inconsistent

Severity: 🔴 error Category: property Phase: 2.12

Description

A Property Get return type and the matching Property Let value-parameter type must agree.

Failing example

Property Get Foo() As Long
End Property
Property Let Foo(ByVal v As String)
End Property

Compliant example

Property Get Foo() As Long
End Property
Property Let Foo(ByVal v As Long)
End Property

How to fix

Make the Get return type and the Let value-parameter type identical.


Source: src/rules.py — entry VBA152.