ParamArray does not work with COM

I have a class library that works with COM as follows:

<ComClass(SomeClass.ClassId, SomeClass.InterfaceId, SomeClass.EventsId)>
Public Class SomeClass

    Public Const ClassId As String = "GUID1"
    Public Const InterfaceId As String = "GUID2"
    Public Const EventsId As String = "GUID3"

    Public Sub SomeMethod(ByVal ParamArray values() As Object)
        ''//Some Code Here    
    End Sub
End Class

Then I used regasm / tlb / codebase to register. All methods and properties seem to work correctly in VBA / VB6, but when I try to access the method with ParamArray, it will not compile the event. I get an error message:

Compilation Error:

A function or interface that is marked as restricted, or the function uses the non-suppport automation type in Visual Basic.

What I need to do to expose this method correctly so that I can use it as follows:

SomeClass.SomeMethod 1, 2, 3
+3
source share
1 answer

the function uses an automation type not supported in Visual Basic.

, VB6. ParamArray. VB6 . , .

+3

Source: https://habr.com/ru/post/1756983/


All Articles