Business Objects从Excel启动

时间:2016-04-18 14:28:03

标签: excel vba business-intelligence business-objects

我正在使用VBA为自己创建Business Objects宏。我发现这个代码和其他各地的论坛相似。但是,在VBA中编译时,一切都在Set BoApp阶段开始冻结。我在创建对象时遗漏了什么? BusinessObjects.application 是否必须说出特定于我的Business Objects目录的其他内容?

感谢任何帮助!

Sub Open_Reports()
    Dim BoApp As Object

Application.DisplayAlerts = False
Application.Wait (Now + TimeValue("1:00:00"))

On Error Resume Next
Set BoApp = CreateObject("BusinessObjects.application")
With BoApp
    .Visible = True
    .LoginAs "username", "password", , "DVBOCEN-APP01"
    .documents.Open ("Q:\MI Reporting (BAU)\BAU Daily\Operational Reports\All reports\Sales - Advisor - Daily.rep")
         With .Activedocument
              .Refresh
              .Close
         End With
    .Application.Quit
End With

Set BoApp = Nothing

ThisWorkbook.Saved = True
.Quit

End Sub

1 个答案:

答案 0 :(得分:2)

不确定它是否有帮助,因为它应该以任何方式工作,但请尝试:

Dim BoApp As busobj.Application

Set BoApp = New busobj.Application

我假设您已经能够手动成功启动DeskI应用程序,并且您已将BusinessObjects x对象库添加为参考?