如何實現我的ClsInterface
類,它有這樣的代碼:實現在VBA我自己的界面 - 錯誤:對象模塊需要實現「X」的界面「Y」
Public Function add(x As Integer, y As Integer) As Integer
End Function
我
Class2
類
,其中有這樣的代碼:
Implements ClsInterface
Public Function add(x As Integer, y As Integer) As Integer
add = x + y
End Function
我的測試代碼
Public Sub test()
Dim obj As New Class2
MsgBox obj.add(5, 2)
End Sub
這總是出現與以下錯誤:
Microsoft Visual Basic
Compile error:Object module needs to implement 'add' for interface 'ClsInterface'
OK/Help
但沒有幫助的Microsoft幫助(當我按下幫助按鈕時)。
任何想法?
這裏的[如何在Excel中使用VBA的器具(http://stackoverflow.com/questions/19373081/ how-to-use-the-implement -excel-vba/19379641#19379641) – 2014-05-01 09:55:07