|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub test1()
k = "{'status':200,'error':'成功','data':{'examInfo':{'id':'a5c6e45ea4dcabf63acb7836760a9ef1','settings':{'isShowAvgTip':'false','isOpenPush':'true','isMatric':'false'"
k = k & ",'isShowScoreRadar':'false','isRemoteSearch':'false'},'name':'XX市2017-2018学年第二学期高二期末水平测试'},'scores':[{'infoDetail':[{'name':'主观题','value':'72'},"
k = k & "{'name':'客观题','value':'25'}],'courseTotalScore':'150','totalScore':'97','totalScoreNum':'97','courseCode':'YW','courseName':'语文'},"
k = k & "{'infoDetail':[{'name':'主观题','value':'28'},{'name':'客观题','value':'45'}],'courseTotalScore':'150','totalScore':'73','totalScoreNum':'73','courseCode':'LSX','courseName':'理科数学'},"
k = k & "{'infoDetail':[{'name':'听说','value':'9'},{'name':'笔试','value':'89'}],'courseTotalScore':'150','totalScore':'98','totalScoreNum':'98','courseCode':'YY','courseName':'英语(含听说)'},"
k = k & "{'infoDetail':[{'name':'客观题','value':'20'},{'name':'主观题','value':'21'}],'courseTotalScore':'100','totalScore':'41','totalScoreNum':'41','courseCode':'WL','courseName':'物理'},"
k = k & "{'infoDetail':[{'name':'主观题','value':'16'},{'name':'客观题','value':'26'}],'courseTotalScore':'100','totalScore':'42','totalScoreNum':'42','courseCode':'HX','courseName':'化学'},"
k = k & "{'infoDetail':[{'name':'客观题','value':'27'},{'name':'主观题','value':'38'}],'courseTotalScore':'100','totalScore':'65','totalScoreNum':'65','courseCode':'SW','courseName':'生物'}]"
k = k & ",'userInfo':{'stName':'XXX','school':'XX市XX中学','examNo':'08190XXXX'}}}"
strJOSN = k9
Set oDom = CreateObject("htmlfile")
Set oWindow = oDom.parentWindow
oWindow.execScript "a=" & strJOSN
MsgBox oWindow.eval("a.error")
MsgBox oWindow.eval("a.data.examInfo.id")
MsgBox oWindow.eval("a.data.scores[0].totalScoreNum")
MsgBox oWindow.eval("a.data.scores[0].infoDetail[1].value")
End Sub
给你参考 |
|