Object doesn't support this property or method
下面的代码给了我一个HelperFunctions.updatecontractlist (PC)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim PCName As String, BU, PC As Variant
If Target.Address = "$B$1" Then
PCName = Target.value
For Each BU In TotalBook.GetBUs
For Each PC In BU.GetPCs
If PC.Name = PCName Then HelperFunctions.updatecontractlist (PC)
Next PC, BU
End If
End Sub
哪里updatecontractlist
是:
Public Sub updatecontractlist(PC As Variant)
whatever
End Sub
并且PC
是自定义对象,在代码的许多其他部分都可以正常工作,我可以在我的Watches
窗口中看到,当错误发生时它已正确加载。
我错过了什么?