Hi Guys,

I have a code:

Sub test()
    Dim cs As Object
    Set cs = CreateObject("System.Collections.Stack")
    Dim dic As Object
    Set dic = CreateObject("Scripting.dictionary")
    Dim i As Long
    
    dic.Add "ok", 1
    dic.Add "ok2", 2
    dic.Add "ok3", 3

    With cs

             Debug.Print CStr(.Push(dic.keys))
''

        For i = 1 To 10
            Debug.Print CStr(.Pop)
        Next i
        
    End With
End Sub
Here i have stack object and dictionary object.

I am passing whole dictionary into first stack item like here:
stack item.png

And now i would like to retrieve second dictionary key from first item in stack so in this case it will be item 1(1) - "ok2".

How can i do it ?

I tried to implement methods like

"Debug.Print CStr(.Pop)(1)(1) but there is an error.

Please help,
Jacek Antek