Hi,
I am using MS Excel and Im trying to write a macro(VBA) that would use classes and implement an interface. I have no idea what im doing wrong but i keeping getting an error prompting me that the Object module needs to implement a function that the interface has declared. But strangely the function is already implemented. My code is a follows:
clsInterface
VB Code:
Public Property Get LibraryItem_CheckedOut() As Boolean End Property
clsDerived
VB Code:
Implements clsInterface Public Sub Class_Initialize() MsgBox "in derived" End Sub Public Property Get LibraryItem_CheckedOut() As Boolean MsgBox "in derived" End Property
And finally, ThisWorkbook
VB Code:
Dim cls As clsInterface Dim derived As clsDerived Set cls = New clsInterface Set derived = new clsDerived Set cls = derived
Ive wrecked my brains of this for hours and have not figured out why i get the error. Again, the error is: "Object module needs to implement 'LibraryItem_CheckedOut' for interface clsInterface
Thanks a million
raven




Reply With Quote