Reputation: 549
I am in the process of creating a Business Objects macro for myself using VBA. I have found this code and others similar across the forums everywhere. However upon compiling this in VBA, everything just starts to freeze at the Set BoApp stage. Am I missing something in creating the object? Does the BusinessObjects.application have to say something else that is specific to my Business Objects directory?
Any help is appreciated!
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
Upvotes: 0
Views: 1433
Reputation: 6827
Not sure if it'll help, since it should work either way, but try:
Dim BoApp As busobj.Application
and
Set BoApp = New busobj.Application
I'm assuming you're able to successfully launch the DeskI application manually, and that you've added the BusinessObjects x Object Library as a reference?
Upvotes: 2