You're looking for something like this:
Set reference to Microsoft Scriptcontrol
Sub ExcelForum()
Dim json As String
Dim Tables As Object, Rows As Object, TableKeys As Object, key
Dim ScriptEngine As ScriptControl
Set ScriptEngine = New ScriptControl
With ScriptEngine
.Language = "JScript"
.AddCode "function getKeys(jsonObj) { var keys = []; for (var i in jsonObj) { keys.push(i); } return keys; } "
End With
ActiveSheet.Cells.ClearContents
With CreateObject("WinHTTP.WinHTTPRequest.5.1")
.Open "POST", "http://www.religareonline.com/Research/DefaultAPI.aspx?action=RES-REP-GETRESLIST", False
.setrequestheader "Referer", "http://www.religareonline.com/research/research-reports/currency-research-reports/4"
.setrequestheader "Cookie", "_ga=GA1.2.1071975320.1437286029; activeMenu=n3Research-menu_r_Res_Rep-submenu_res_Currency; _gat=1"
.send "p_pageno=1&p_code=&p_asset=4&p_assettype=Currency&p_broker=&p_status=0&p_usertype=0&p_title=&p_expiredonly=&p_todate=&p_fromdate=&p_id=&p_exchangeName=&p_exchange=&p_cname=&p_InsType=&p_type=&p_Symbol=&p_ExpiryDate=&p_featured=&p_OptionType=&p_StrikePrice=&EquityTag=&IPOTag=&MFTag=&DerTag=&comTag=&curTag=&p_PassiveModFlag=&p_DeliveryID=1&p_TimehorizonID=&p_RCommID=&p_RepType=&p_assettypeID=4"
json = .responseText
End With
Set Tables = ScriptEngine.Eval("(" & json & ")")
json = CallByName(Tables, "data", VbGet)
Set Tables = ScriptEngine.Eval("(" & json & ")")
Set Tables = CallByName(Tables, "response", VbGet)
Set Tables = CallByName(Tables, "reportlist", VbGet)
Set Tables = CallByName(Tables, "report", VbGet)
Set TableKeys = ScriptEngine.Run("getKeys", Tables)
For Each key In TableKeys
Set Rows = CallByName(Tables, key, VbGet)
If CallByName(Rows, "title", VbGet) = Replace(CallByName(Rows, "desc", VbGet), "+", " ") Then GoTo nextkey
ActiveSheet.Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Offset(1) = CallByName(Rows, "publisheddate", VbGet)
ActiveSheet.Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Offset(, 1) = CallByName(Rows, "title", VbGet)
ActiveSheet.Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Offset(1) = Replace(CallByName(Rows, "desc", VbGet), "+", " ")
nextkey:
Next key
ActiveSheet.Cells.WrapText = False
json = vbNullString
Set Rows = Nothing
Set Tables = Nothing
Set TableKeys = Nothing
Set ScriptEngine = Nothing
End Sub
As always - props to Kyle123 for originally coming up with this
Bookmarks