You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I should have deleted the declarations of V and Ar; I'd used them to check behaviour with array keys. Neither Scripting.Dictionary nor VBA-Dictionary accept them, but they may not return the same error number when one tries.
Sub T2()
Dim SD As Object
Dim VD As Dictionary
Dim C As Collection
Dim V As Variant
Dim Ar(1) As Long
Const MSG = "This item's key is a collection"
Set SD = CreateObject("Scripting.Dictionary")
Set VD = New Dictionary
Set C = New Collection
C.Add "First"
C.Add "Second"
SD.Add "Ocelot", "Cat"
SD.Add C, MSG
Debug.Assert SD(C) = MSG
VD.Add "Ocelot", "Cat"
VD.Add C, MSG 'Error 457
End Sub
The text was updated successfully, but these errors were encountered: