我使用以下代码行将VBA连接到SAP会话,并且运行良好:
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.但是,这在5中的SAP中不起作用。
SAP GUI:

SAP NW业务客户端5中的SAP:

如何更改代码,使其既适合SAP,又适合SAP业务客户端?
发布于 2019-05-07 13:20:55
而不是Set SapGuiAuto = GetObject("SAPGUI")
我使用了Set SapGuiAuto = GetObject("SAPGUISERVER"),这使我的代码在Neveawer上工作。
https://stackoverflow.com/questions/55628588
复制相似问题