Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dictionary in VBA is created with empty key value pair

After creating a new dictionary:

Dim teams as Dictionary
Set teams = New Dictionary

I noticed that it already contains empty key - value pair (teams.Count returns value of 1). How can I prevent this from happening or delete this pair? Is this normal behaviour?

like image 741
Cameel Avatar asked Dec 01 '22 03:12

Cameel


1 Answers

I had the same experience and solved it.

I had a Watch expression set for a value in the dictionary. Somehow this kept the empty key/value pair in the dictionary (or kept readding it).

Removing the watch(es) and stepping through the code I now see the dictionary does not have the Empty/Empty item any longer.

like image 195
Keith Twombley Avatar answered Dec 04 '22 09:12

Keith Twombley