A Parameter passed by Reference Cannot have a Default Value Error

In the method declaration, you declared a parameter ByRef but also tried to assign it a default value.


Example

The following parameter declaration is not allowed

ByRef a As Integer = 5

:

You can either remove the ByRef keyword or remove the default value assignment.


See Also

ByRef keyword.