Symptoms
Microsoft Visual Basic version 6.0 cannot use the .NET method with the ParamArray parameter in Microsoft Visual Studio .NET. A compile-time error is generated by Visual Basic version 6.0 when it tries to consume the .NET method that has the ByRef ParamArray parameter or the ByRef Structure parameter.
When the .NET method has the ByRef ParamArray parameter, you receive the following error message:
Compile error:
Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic
When the .NET method has the ByRef Structure parameter, you receive the following error message:
Compile error:
User-defined type may not be passed ByVal
Resolution
This problem occurs because Visual Basic version 6.0 does not let the ParamArray parameter and the Structure parameter be passed to the BYVAL value. This problem occurs with a .NET property because a .NET property does not let property parameters be defined by the BYREF value.