I wrote this script because I once was bitten by the fact(?) that the special key name values cannot be used with the exclamation point notation (jsonTest!values).
option explicit
sub jsonTest()
dim jsonText as string
jsonText = "{" & _
"""keyOne"": [""zero"", ""one"", ""two"", ""three""]," & _
"""keyTwo"": {""num"": 42, ""txt"": ""Hello world.""}" & _
"""values"": {""num"": 99, ""txt"": ""ninety-nine.""}" & _
"}"
dim jsonParsed as dictionary
set jsonParsed = parseJson(jsonText)
'
' Iterate over keys
'
dim k as variant
for each k in jsonParsed
debug.print "key = " & k
next k
debug.print ""
debug.print "jsonParsed!keyOne(2) = " & jsonParsed!keyOne(2)
debug.print "jsonParsed!keyTwo!num = " & jsonParsed!keyTwo!num
debug.print "jsonParsed(""values"")!num = " & jsonParsed("values")!num ' jsonParsed!values does not seem to work...
debug.print ""
dim e as variant
for each e in jsonParsed!keyOne
debug.print e
next e
end sub