Skip to content

VBA136 — Array parameter passed ByVal

Severity: 🔴 error Category: signature Phase: 2.10

Description

Array parameters must be passed ByRef; ByVal arrays are illegal in VBA.

Failing example

Sub S(ByVal a() As Long): End Sub

Compliant example

Sub S(ByRef a() As Long): End Sub

How to fix

Change the parameter mechanism to ByRef (the default).


Source: src/rules.py — entry VBA136.