ranjithkumar10

import JSON from API

Dec 16th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.42 KB | None | 0 0
  1. Public Sub exceljson()
  2. Dim http As Object, JSON As Object, i As Integer
  3. Set http = CreateObject("MSXML2.XMLHTTP")
  4. http.Open "GET", "YOUR_API_HERE", False
  5. http.send
  6. Set JSON = ParseJson(http.responseText)
  7. i = 2
  8. For Each Item In JSON("data")
  9. Sheets(1).Cells(i, 1).Value = Item("id")
  10. Sheets(1).Cells(i, 2).Value = Item("name")
  11. Sheets(1).Cells(i, 3).Value = Item("active")
  12. i = i + 1
  13. Next
  14. MsgBox ("complete")
  15. End Sub
Add Comment
Please, Sign In to add comment