艺赛旗 RPA9.0全新首发免费下载 点击下载
http://www.i-search.com.cn/index.html?from=line1
详细内容请参看艺赛旗官网支持栏目:RPA社区
点击链接进入 http://support.i-search.com.cn/
业务场景
使用 win32com 运行 Excel 中的宏运算(VBA),会遇到 VBA 运行的最后一步会弹出消息提示框,需点击这个消息提示框之后,VBA 才能运行结束,所以在运行 VBA 之后加入 Try 组件去点击时无法点击的,所以考虑使用多线程来实现。
流程代码
import ubpa.iautomation as iautomation
import threading
import pythoncom
import time
#点击消息提示框按钮
def cilck_ok():
while True:
# Try异常
try:
# 鼠标点击
iautomation.WinSearchDepth=2
selectorJson = {“selector”:[{“ControlType”:“按钮”,“ControlTypeID”:“0xC350”,“Index”:“1”},
{“ControlType”:“对话框”,“ControlTypeID”:“0xC370”,“Index”:“1”}]}
iautomation.do_click(win_class=r’XLMAIN’,win_name=r’aaaa.xlsm -