|
Sub main()
ActiveSheet.UsedRange.ClearContents
url = "http://www.qzzb.gov.cn/default/getCalDetail.do"
With CreateObject("msxml2.xmlhttp")
.Open "POST", url, False
.send ("{openDate:'2018-7-10',centerId:0}")
json = .responsetext
End With
js = "j=" & json & ";js=j['data'];var r,k,row=col=1,d={},title=['centerName','projName','ownerDeptName'," _
& "'agentDeptName','linkMan','linkTel','openDate','tradeplatName'];for(r in js){row++;for(k in title)" _
& "{if(!d[title[k]]){d[title[k]]=col++;rng(1,d[title[k]])=title[k];}rng(row,d[title[k]])=js[r][title[k]];}}"
With CreateObject("scriptcontrol")
.Language = "jscript"
.addobject "rng", Cells(1, 1)
.eval (js)
End With
End Sub |
|