Excel vba: Property let procedure not defined and property get procedure did not return an object

前端 未结 3 1571
广开言路
广开言路 2021-01-23 12:02

I have a Client class. Inside that class there is an array losses. First I create and populate with clients a clientsColl array. Then for

3条回答
  •  感动是毒
    2021-01-23 12:19

    Your getLosses property doesn't take an argument so your syntax is actually wrong, even though VBA can cope with it when early bound. You should be using:

    Debug.Print "first: " & clientsColl(1).getLosses()(1) 'works fine
    For Each clientCopy In clientsColl
        Debug.Print "in for each: " & clientCopy.getLosses()(1) 'error here
    Next
    

提交回复
热议问题