=========================================================================
rem excel更改檔案類型從xls變更為xlsx
userpath = Sys.GetHomePath()
filepath = userpath&'''\desktop\uibot\projects\ACON\ZMM1003\'''
Rem 檢查檔案是否存在, 若存在, 則刪除
bRet = File.FileExists(filepath&"receiving.xlsx")
If bret
File.DeleteFile(filepath&"receiving.xlsx")
Else
End If
objExcelWorkBook = Excel.OpenExcel(filepath&"receiving.xls",True,"Excel","","")
Delay(5000)
Keyboard.Press("F12", "press", [],{"iDelayAfter":500,"iDelayBefore":200,"sSimulate":"simulate"})
Delay(200)
#icon("@res:0l0iqdvh-tenn-55sc-a2p9-8srbge7o4ath.png")
Keyboard.InputText({"wnd":[{"app":"EXCEL","cls":"#32770","title":"另存新檔"},{"cls":"DUIViewWndClassName"},{"cls":"DirectUIHWND","aaname":"檔案總管窗格"},{"cls":"FloatNotifySink"},{"cls":"ComboBox","aaname":"檔案名稱:"},{"cls":"Edit","ctrlid":1001,"aaname":"檔案名稱:"}]},"receiving",True,20,10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":500,"bSetForeground":True,"sSimulate":"message","bValidate":False,"bClickBeforeInput":False})
Delay(200)
Keyboard.Press("Tab", "press", [],{"iDelayAfter":500,"iDelayBefore":200,"sSimulate":"simulate"})
Delay(200)
Keyboard.Press("Down", "press", [],{"iDelayAfter":500,"iDelayBefore":200,"sSimulate":"simulate"})
Delay(200)
Keyboard.Press("Home", "press", [],{"iDelayAfter":500,"iDelayBefore":200,"sSimulate":"simulate"})
Delay(200)
Keyboard.Press("Enter", "press", [],{"iDelayAfter":500,"iDelayBefore":200,"sSimulate":"simulate"})
Delay(200)
Keyboard.Press("S", "press", ["Alt"],{"iDelayAfter":500,"iDelayBefore":200,"sSimulate":"simulate"})
Delay(200)
Excel.CloseExcel(objExcelWorkBook,True)