gpt4 book ai didi

vba - 在 VBA 中自动化 SAP 业务对象的 Web 服务登录

转载 作者:行者123 更新时间:2023-12-04 17:59:55 26 4
gpt4 key购买 nike

是否可以使用 Excel 中的 Analysis for Microsoft Excel COM 加载项自动登录 SAP Business Objects Web 服务?当我运行我的代码时,我会看到下面的“登录到 SAP BusinessObjects BI 平台”窗口,要求用户手动输入他们的 Web 服务凭据(注意:这些与他们的 SAP 凭据不同)。理想情况下,我无需任何用户交互即可设置所有字段(用户、密码、Web 服务 URL、系统和身份验证)。

Web Service Logon Window

我正在尝试使用 VBA 代码自动刷新连接到 SAP Business Objects 的 Excel 工作簿。通过查看 SAP 上可用的开发人员文档(请参阅 here ),我能够自动执行大多数命令。还有一个命令“SAPLogon”,但这只能提供 SAP 登录凭据,不能提供 Web 服务凭据。

我的代码示例如下:

'Refresh dashboard
LResult = Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "Off")
LResult = Application.Run("SAPSetRefreshBehaviour", "On")
LResult = Application.Run("SAPExecuteCommand", "Refresh")
If LResult = 0 Then
'Refresh failed. Exit with error.
StrMsg = "Unable to retrieve variables or refresh any data; script will now exit. Please close Excel, open a new instance of Analysis for Microsoft Excel, and try again."
LogMsg StrMsg
MsgBox StrMsg
GoTo Exit_UpdateDashboard
End If

在执行此代码块之前,我希望自动执行用户登录。我对此进行了广泛研究,但找不到任何人通过 VBA 自动登录 Web 服务的示例。到目前为止我尝试过的一些链接是:

最佳答案

我认为这是不可能的,因为提供的用于连接 Web 服务的库仅适用于 .Net 和 Java。我曾尝试从 WSDL 构建 SOAP 信封,但从未成功过。但是,使用 SDK 中的库相对容易。我曾经在 CShap 中为 Excel 构建了一个插件来直接从 Excel 管理和刷新报告:https://code.google.com/archive/p/bo-utils/

关于vba - 在 VBA 中自动化 SAP 业务对象的 Web 服务登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36731286/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com