1
我有一组所有者,每个所有者都有自己的一组机会。VBA将对象传递到另一个对象集合
我有两个类模块,ClmOpportunity具有一束性质的,和ClmOwner其具有单一的名称属性和集合存储ClmOpportunity对象:
Public name As Variant
Private opps As New collection
Public Function addOpportunity(opp As ClmOpportunity)
opp.ID = opps.Count + 1
opps.Add opp, opps.Count + 1
End Function
这些所有者对象也被存储在集合中在我的主模块中。当我尝试使用功能addOpportunity如下图所示:
Dim item As New ClmOpportunity
item.name = "test"
owners.item(overallOwner).addOpportunity (item)
我得到的错误:
"object doesn't support this property or method"
我很新的VBA,我不明白这是为什么,我传递在ClmOpportunity中,所以它应该没问题吧?
任何帮助将不胜感激!
感谢你的回复 – Steven