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)
''
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
source
share