Option Strict On disallows narrowing from type '<typename1>' to type '<typename2>' in copying the value of ByRef parameter <parametername>' back to the matching argument

A procedure call supplies a ByRef argument with a data type that widens to the argument's declared type, and Option Strict is On. The widening conversion is allowed when the argument is passed to the procedure, but when the procedure modifies the contents of the variable argument in the calling code, the reverse conversion is narrowing. Narrowing conversions are not allowed with Option Strict On.

Error ID: BC32029

To correct this error

  • Supply each ByRef argument in the procedure call with the same data type as the declared type, or turn Option Strict Off.

See Also

Concepts

Passing Arguments by Value and by Reference

Widening and Narrowing Conversions

Implicit and Explicit Conversions

Reference

Option Strict Statement