Skip to content

VBA133 — ParamArray combined with Optional

Severity: 🔴 error Category: signature Phase: 2.10

Description

A procedure cannot mix Optional parameters with a ParamArray.

Failing example

Sub S(Optional a As Long, ParamArray b() As Variant): End Sub

Compliant example

Sub S(a As Long, ParamArray b() As Variant): End Sub

How to fix

Drop the Optional markers or the ParamArray — they are mutually exclusive.


Source: src/rules.py — entry VBA133.