ranjithkumar10

Parse nested json in VBA

Jan 13th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.36 KB | None | 0 0
  1. Public Sub nestedjson()
  2. Dim http As Object
  3. Set http = CreateObject("MSXML2.XMLHTTP")
  4. http.Open "GET", "https://api.myjson.com/bins/ej517", False
  5. http.send
  6. Set JSON = ParseJson(http.responseText)
  7. MsgBox (JSON("routes")(1)("legs")(1)("distance")("text"))
  8. MsgBox (JSON("routes")(1)("legs")(1)("distance")("value"))
  9. End Sub
  10. 'credits - https://codingislove.com
Add Comment
Please, Sign In to add comment