我的机器上没有直接安装 SAP,并通过以下链接使用 SAP 窗口。
https://nedc-ctx.applications.services.axa-tech.intraxa/Citrix/AccessPlatform/auth/loggedout.aspx
我知道 SAP GUI 的记录和运行功能正在运行。我仅在培训版本中具有此访问权限。在生产中我无法使用运行和记录选项。
如何从 Excel VBA 打开 SAP 窗口、连接并加载数据?
在下面的代码中我收到错误。
我发现我无法在我的计算机上添加参考文件“sapfewse.ocx”。
如果我们通过上面提供的链接访问 SAP,是否可以通过 Excel VBA 连接 SAP。单击上面的链接后,新的弹出窗口将通过窗口与 SAP 连接。 SAP 通过 Citrix 进行连接。
代码(取自此帮助链接):
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 = SAPCon.Children(0) 'Get the first session (window) on that connection
'Start the transaction to view a table
session.StartTransaction "SE16"
仅当您的计算机上安装了 SAP GUI 时,您提供的代码才有效。
我建议询问 IT 团队是否可以为您提供服务器地址,以便您可以使用远程函数调用自动检索数据。这可以使用 VBA 来完成(https://archive.sap.com/discussions/thread/129358)
您需要调整链接中的代码以满足您的需求
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)