我对 VBA 完全陌生,我会很感激一些应该是微不足道的帮助。我有以下代码:
Sub sub1()
Dim buys As Collection
Dim sells As Collection
Set buys = New Collection
Set sells = New Collection
handleBuy rowCounter, buys, sells
End Sub
Sub handleBuy(ByVal rowNum As Integer, ByRef listBuys As Collection, ByRef listSells As Collection)
'do something here with the collections
End Sub
上述集合包含由我定义的类实例化的对象。当我尝试运行上面的代码时,我得到一个运行时错误 424 “Object Required” 错误发生在对 handleBuy 的调用发生的地方。我在这里想念什么?任何帮助是极大的赞赏。