Excel VBA连接到SAP GUI,但不连接到SAP NW Business Client 5
我使用以下代码行将VBA连接到SAP GUI会话,效果良好:Excel VBA连接到SAP GUI,但不连接到SAP NW Business Client 5,excel,vba,sap,Excel,Vba,Sap,我使用以下代码行将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.Child
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?而不是
设置SapGuiAuto=GetObject(“SAPGUI”)
我曾经
Set-SapGuiAuto=GetObject(“SAPGUISERVER”)
这使得我的代码在Neveawer上工作