Excel VBA 解析 JSON

Sub bluejson()  'ok
    Dim aa
    Set x = CreateObject("ScriptControl"): x.Language = "JScript"
    aa = "{""myname"":""Michael"",""myaddress"":{""city"":""Beijing"",""street"":"" Chaoyang Road "",""postcode"":100025}}"
    Set y = x.eval("eval(" & aa & ")")
    MsgBox y.myname
    MsgBox y.myaddress
    MsgBox y.myaddress.city
    MsgBox y.myaddress.postcode
    'Stop
End Sub

  

posted @ 2015-06-29 15:16  哈度普  阅读(7185)  评论(0编辑  收藏  举报