【发布时间】:2014-12-06 23:31:03
【问题描述】:
初学者在这里学习类模块。我在基础知识方面遇到了麻烦-
当我设置(让)属性时,我得到“编译错误:参数数量错误或属性评估无效”,.Name 属性:
Sub test()
Dim acc As account
Set acc = New account
MsgBox (acc.Name("First Account").rowNum())
End Sub
这是“帐户”类模块:
Private strAccName As String
Private mlngRowNum As Long
Public Property Let Name(strN As String)
strAccName = strN
End Property
Public Property Get rowNum(exists As Boolean)
dim rowNum as Long
'...some logic here...
'...
getRowNum = rowNum
End Property
所以应该是我在 Let 方法中出错了?非常感谢您的建议
【问题讨论】: