所以我使用SAP GUI记录器录制了一个脚本。我基本上只运行7个报告并将内容保存到excel文件中。代码没有什么吸引力,只是一些变化。
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "SAP_ALL.TXT"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 11
但有时报告中没有记录。
if/then/else
,但找不到一个好的例子。如何从这个或其他错误中捕获并恢复?sapshcut
或构建脚本以避免此问题?欢迎相关的例子。我是RTFM,但我没有。
答案 0 :(得分:0)
例如:
...
session.findById("wnd[0]/tbar[1]/btn[8]").press
on error resume next
'This command must be recorded once in your environment. It's a mouseclick in the first line.
session.findById("wnd[0]/usr /subSUB_AREA_ROOT:SAPLREIS_GUI_CONTROLLER:0200/subSUB_AREA:SAPLREIS_GUI_CONTROLLER:1000/cntlCC_LIST/shellcont/shell").currentCellRow = 1
if err.number = 0 then
on error goto 0
...
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "SAP_ALL.TXT"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 11
...
else
on error goto 0
...
end if
...
VBA 2010 - Hide all SAP windows using .iconify
此致 ScriptMan