- uibot 获取excel大范围数据然后对应的填入各个web框中
-
Dim bRet = "" Dim objRet = "" Dim arrSet = "" Dim arrayRet = "" Dim objExcelWorkBook = "" objExcelWorkBook = Excel.OpenExcel('''C:\Users\Asus\Documents\Tencent Files\1778296894\FileRecv\合并3.xlsx''',False,"WPS","","") objRet = Excel.ReadCell(objExcelWorkBook,"sheet1","A20151:A30000")//A16322:A30000、、A19659 //A18362 //arrayRet = Excel.ReadRange(objExcelWorkBook,"Sheet1","D2:D96") //arrayRet = Excel.ReadColumn(objExcelWorkBook,"Sheet1","D9") Excel.CloseExcel(objExcelWorkBook,True) arrSet = Set.ToArray(objRet) For Each id_no In arrSet If id_no = "" Continue Else #icon("@res:piuqo5gi-1vu1-moc0-9k5o-3m07us5kf22k.png") Keyboard.InputText({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"INPUT","id":"c4_wlno"}]},id_no,True,20,10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":500,"bSetForeground":True,"sSimulate":"message","bValidate":True,"bClickBeforeInput":True}) #icon("@res:b2dlcs8v-m66h-p9tf-s6ca-mm3609mj6o80.png") UiElement.SetSelect({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"SELECT"}]},"所有","text",{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200}) #icon("@res:jjjp4ipl-lci5-ujri-risl-0bopeeh30gk5.png") Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"filterMoreDiv"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":400,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False}) Delay(5000) #icon("@res:i8tqf393-ff8h-1bof-arhc-08u532i88nqe.png") bRet = UiElement.Exists({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"A","parentid":"dwData","aaname":"编辑","tableRow":"2"}]},{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200}) If bRet = True TracePrint("11修改成功~~~~:"&id_no) #icon("@res:juoaoona-28j5-59pf-ajo2-veastu3ivnft.png") Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"A","parentid":"dwData","aaname":"编辑","tableRow":"2"}]},"left","click",5000,{"bContinueOnError":True,"iDelayAfter":200,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False}) #icon("@res:pv30l4hu-eg79-g12u-50nu-sh7bad825umr.png") bRet1 = UiElement.Exists({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"c1main","aaname":"完成"}]},{"bContinueOnError":True,"iDelayAfter":200,"iDelayBefore":200}) If bRet1 = True #icon("@res:a7dfde5i-h2al-e28f-rbnb-8ir8hht37ccu.png") Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"c1main","aaname":"完成"}]},"left","click",5000,{"bContinueOnError":True,"iDelayAfter":200,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False}) #icon("@res:dcoonj88-fde3-pbkp-ulev-7699f2sorgp1.png") Keyboard.InputText({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"TEXTAREA"}]},"您的公交卡已制作完毕。",True,20,6000,{"bContinueOnError":True,"iDelayAfter":200,"iDelayBefore":200,"bSetForeground":True,"sSimulate":"message","bValidate":False,"bClickBeforeInput":False}) // dim count = 0 // #icon("@res:9bujp12u-6sna-o33f-5amf-u9dkvtca9ors.png") // bRet2 = UiElement.Exists({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"A","aaname":"确定完成"}]},{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200}) // If bRet2 = true #icon("@res:k23ajud4-fnoh-4v89-s542-255ch9hig1id.png") Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"A","aaname":"确定完成"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False}) //end if TracePrint("22修改成功~~~~:"&id_no) Delay(13000) #icon("@res:s2tep3an-ngdr-33bt-ulu7-pfq1sfp96hmh.png") Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"filterMoreDiv"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False}) Delay(4000) Else TracePrint("33原本是已经点击完成状态!!:"&id_no) #icon("@res:ueqrsmgd-r8g1-33ov-dqtk-pp8gif7iricu.png") Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"c1main","aaname":"关闭"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False}) Continue End If Else TracePrint("44原本就是修改成功的~~~~:"&id_no) Delay(2000) Continue End If End If Next CollectGarbage