Vignesh Subramanian
Vignesh Subramanian

Reputation: 7289

Fetching values from an array in VBA Excel

I have built an array, when I add it to watch

dict.Items

It returns

Expression                    Values
dict.Items                  
--dict.Items(0)                "value in it"
--dict.Items(1)                "value in it"
--dict.Items(2)                "value in it"

But when I try to add watch to expression

dict.Items(0)

It returns the following

Watch :   : dict.keys(0) : <Property let procedure not defined and property get procedure did not return an object> : Variant/Empty : VBAProject.basMigration.UniqueReport

enter image description here

Upvotes: 0

Views: 162

Answers (1)

Rory
Rory

Reputation: 34045

The Items method doesn't take an index - it only returns the whole array, so you'd need to add a watch for Items()(0) rather than Items(0)

Upvotes: 1

Related Questions