|
楼主 |
发表于 2015-3-29 18:30
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
东方财富网 > 数据中心 > 特色数据 > 股市日历 股市日历(2015-03-29)
- Sub test()
- Dim strJs, P
- Cells.ClearContents
- With CreateObject("Microsoft.XMLHTTP")
- .Open "get", "http://datainterface.eastmoney.com/EM_DataCenter/JS.aspx?type=GSRL&sty=GSRL&stat=10&fd=2015-03-29&sr=2&p=1&ps=1&js=(pc),(x)&callback=callback&_=1427621922927", False
- .send
- P = Split(.responsetext, ",")(0)
- .Open "get", "http://datainterface.eastmoney.com/EM_DataCenter/JS.aspx?type=GSRL&sty=GSRL&stat=10&fd=2015-03-29&sr=2&p=1&ps=" & P & "&js={pages:(pc),data:[(x)]}&_=1427621922927", False
- .send
- ' Debug.Print .responsetext
- strJs = "var a=" & .responsetext & ";var b=a.data;var s=''; for(x in b){for(y in b[x]){s+=b[x][y]+'\t'};s+='\r'} "
- End With
- With CreateObject("MSScriptControl.ScriptControl")
- .Language = "javascript"
- strJs = .Eval(strJs)
- End With
- Arr = Split(strJs, vbCr)
- With ActiveSheet
- .[a2].Resize(UBound(Arr)) = WorksheetFunction.Transpose(Arr)
- .[a:a].TextToColumns Destination:=Range("A1")
- End With
- End Sub
复制代码 |
|