This will dump the data in the first sheet, starting at A1
Public Sub getData()
Dim JSONObject As Object
Dim scriptControl As Object
Dim JS As Object
Dim x As Long: x = 1
Set scriptControl = CreateObject("MSScriptControl.ScriptControl")
scriptControl.Language = "JScript"
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "http://api.manilainvestor.com/v1/stocks/hdata/dnl", False
.send
Set JSONObject = scriptControl.Eval("(" + .responsetext + ")")
.abort
For Each JS In JSONObject
Sheets(1).Cells(x, 1).Value = JS.Date / (CDbl(60) * CDbl(60) * CDbl(24)) + #1/1/1970#
Sheets(1).Cells(x, 2).Value = JS.High
Sheets(1).Cells(x, 3).Value = JS.Low
Sheets(1).Cells(x, 4).Value = JS.Open
Sheets(1).Cells(x, 5).Value = JS.Close
Sheets(1).Cells(x, 6).Value = JS.Volume
x = x + 1
Next JS
End With
End Sub
Bookmarks