VBA 中的 SAP 业务对象自动化 Web 服务登录
Automating a Web Service Login for SAP Business Objects in VBA
是否可以使用 Excel 中的 Analysis for Microsoft Excel COM 加载项自动登录 SAP Business Objects Web 服务?当我 运行 我的代码时,我会看到下面的 "Logon to SAP BusinessObjects BI Platform" window 要求用户手动输入他们的 Web 服务凭据(注意:这些与他们的 SAP 凭据不同)。理想情况下,我可以在没有任何用户交互的情况下设置所有字段(用户、密码、Web 服务 URL、系统和身份验证)。
我正在尝试使用 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/
是否可以使用 Excel 中的 Analysis for Microsoft Excel COM 加载项自动登录 SAP Business Objects Web 服务?当我 运行 我的代码时,我会看到下面的 "Logon to SAP BusinessObjects BI Platform" window 要求用户手动输入他们的 Web 服务凭据(注意:这些与他们的 SAP 凭据不同)。理想情况下,我可以在没有任何用户交互的情况下设置所有字段(用户、密码、Web 服务 URL、系统和身份验证)。
我正在尝试使用 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/