Changing nested dictionary in VBA -


i ask question when solution came in 1 test. i'm posting anyway , answering, others can benefit.

the question was:

i run code below , runtime error 450 - wrong number of arguments or invalid property assignment

dim data, tmpdict dictionary set data = new dictionary set tmpdict = new dictionary  data.add 123, tmpdict  set tmpdict = data.item(123) tmpdict.add "somekey", 100 data.item(123) = tmpdict 

the error occur in last line. code simplified focus on changing nested dictionary in existing item.

how can succeed in this?

the solution can achieved contracting last 3 lines in 1, using:

data.item(123).add "somekey", 100 

instead of:

set tmpdict = data.item(123) tmpdict.add "somekey", 100 data.item(123) = tmpdict 

Comments

Popular posts from this blog

objective c - Deep Linking for iOS Apps which are not installed yet? -

javascript - SignalR sharing connection between 2 apps -