I am trying to implement a new class that implements two interfaces in Excel VBA, but I have problems with compilation because the members of the interfaces do not seem to be implemented properly in the implementation class (they are not callable).
The interfaces are as follows:
ICrawlable:
Option Explicit
Public Function GetCrawler() As ICrawler
End Function
IEquatable:
Option Explicit
Public Function Equals(CompareObject As Variant) As Boolean
End Function
While it ICrawlablealso contains a function that returns an interface ICrawler:
Option Explicit
Public Property Get CurrentItem() As Variant
End Property
Public Sub MoveNext()
End Sub
Public Function GetNext() As Variant
End Function
Public Function ItemsLeft() As Boolean
End Function
I created a sample class InterfaceTesterusing these first two interfaces:
Option Explicit
Implements ICrawlable
Implements IEquatable
Private Function ICrawlable_GetCrawler() As Variant
End Function
Private Function IEquatable_Equals(CompareObject As Variant) As Boolean
End Function
When trying to use this class in a module or anywhere, I do not have Intellisense support. In addition, the code does not compile, and I get "Method or Datamemeber not found" in this module code, highlighting .Equals:
Sub TestInterfacing()
Dim TestInstance As InterfaceTester
Set TestInstance = New InterfaceTester
Dim VerificationInstance As InterfaceTester
Set VerificationInstance = New InterfaceTester
Dim Result As Boolean
Result = TestInstance.Equals(VerificationInstance)
End Sub
VBA? , ( Variant )? ( )?
?