Dim arr As New Collection, a
Dim aFirstArray() As Variant
...some code
For Each a In aFirstArray
arr.Add a, a
Next
i get this error: This key is already associated with an element of this collection
on this line : arr.Add a, a
what am i doing wrong?
Some more code?
from this what you have all I can tell you is that what your error says. The
ais already in the collection (the key is supposed to be an unique string). BTW. is theaa string?Or maybe you have some repetition in your array which would try to add 1+ time the same item?