我使用以下代码行将VBA连接到SAP GUI会话,并且运行良好:
Sub Change_date()
Dim SapGuiAuto
Dim SetApp
Dim Connection
Dim Session
Set SapGuiAuto = GetObject("SAPGUI")
Set SetApp = SapGuiAuto.GetScriptingEngine
Set Connection = SetApp.Children(0)
Set Session = Connection.Children(0)
'And so on.
但是,这在SAP NetWeaver Business Client 5中的SAP GUI中不起作用。
SAP GUI:
SAP NW Business Client 5中的SAP GUI:
如何更改代码以使其适用于SAP GUI和SAP NW Business Client?
1条答案
按热度按时间8yparm6h1#
而不是
Set SapGuiAuto = GetObject("SAPGUI")
我使用了
Set SapGuiAuto = GetObject("SAPGUISERVER")
,这使得我的代码在Neveawer上工作。