错误似乎发生在for循环的开头,这里是代码
Sub constructContractScurves(contractCollection As Collection)
Dim xArray() As Variant
Dim yArray() As Variant
Dim ans As Boolean
Dim contract As CContract
For Each contract In contractCollection
xArray = constructXarray(contract.numMonths)
yArray = constructYarray(xArray, contract.numMonths)
ans = utilityMod.populateSheet(xArray, yArray, "S-Curve-BW", 49, 7)
Next contract
End Sub
答案 0 :(得分:0)
感谢您的回复,感谢您。问题是调用此子函数的函数在if语句中具有集合的实例化,因此如果不满足条件,则集合不会成为实例。当我把它从if语句中取出时,代码编译成功。
由于