我正在使用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
答案 0 :(得分:2)
不确定它是否有帮助,因为它应该以任何方式工作,但请尝试:
Dim BoApp As busobj.Application
和
Set BoApp = New busobj.Application
我假设您已经能够手动成功启动DeskI应用程序,并且您已将BusinessObjects x对象库添加为参考?