【发布时间】:2014-06-10 14:18:35
【问题描述】:
我正在尝试启动 SAP GUI 脚本并更改 VBA 代码的一些变量。
我明白了
需要运行时错误“424”对象
在Set session = Connection.Children(0)
Public Sub SimpleSAPExport()
Set SapGuiAuto = GetObject("SAPGUI") 'Get the SAP GUI Scripting object
Set SAPApp = SapGuiAuto.GetScriptingEngine 'Get the currently running SAP GUI
Set SAPCon = SAPApp.Children(0) 'Get the first system that is currently connected
Set session = Connection.Children(0) 'Get the first session (window) on that connection
' Start the transaction to view a table
session.StartTransaction "SE16"
end sub
【问题讨论】:
-
在每个“
set XXX =”之后添加:if XXX is nothing then msgbox "the thing above is broken" -
runtime error '424' Object required and VBA 突出显示以下行 Set session = Connection.Children(0)