VB script to open a Business Objects report

15 pts.
Tags:
Business Objects
VBScript
Hello, I would like to know how I can write a windows script to open a Business Object report. So far, I have gotten it to open up the Business Object application, but does not want to open up the report. This is what I have so far. It works until you get to the Getfile. Any help would be appreciated. Dim F Set objbo = CreateObject("WScript.Shell") set anobj = CreateObject("Scripting.FileSystemObject") objbo.Exec ("C:Program FilesBusiness ObjectsBusinessObjects Enterprise 6binbusobj.exe") WScript.Sleep 5500 objbo.SendKeys"xxxxxx" objbo.SendKeys"{ENTER}" f = anobj.Getfile("\Rmregfile002userse716666Business ObjectsprgHospitalClaim.rep")

Answer Wiki

Thanks. We'll let you know when a new response is added.

This code works for me :

Sub GetBOData()
Dim BoApp As busobj.Application, BODoc As busobj.Document, BORep As busobj.Report
Dim i As Integer

Set BoApp = CreateObject(“BusinessObjects.application”)
With BoApp
.LoginAs “jjacob”, “jerry”
.Visible = True
.Documents.Open (“C:\\Jerry\Desktop\ABC Upload\ABC Trends.rep”)
With .ActiveDocument
.Refresh
i = 1
For Each rpt In .Reports
rpt.Activate
BoApp.CmdBars(2).Controls(“&Edit”).Controls(20).Execute

Sheets(i).Select
Range(“A1″).Select
ActiveSheet.PasteSpecial Format:=”Text”, Link:=False, DisplayAsIcon:= _
False

i = i + 1
Next
End With
End With

Set BoApp = Nothing
Set BODoc = Nothing

End Sub

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Jerry Lees
    Be sure and check out my blog here on ITKE for more Network administration and VBSCRIPT tips. The VBScript Network and Systems Administrator's Cafe
    5,335 pointsBadges:
    report
  • Suncawy
    Thank you for the response. Business Objects also owns Crystal Reports, I'm not sure if your familiar with Crystal, but they are both owned by the same company. It's hard to describe Business Objects other than saying its a Business Intelligence application. It has both a desktop version and what they call a "webi" version (web application). Anyways, to get into the application (desktop or webi) you must supply a username and password, which is why I had the send keys in there. Its my intent to have the application be up and running first. Then have the .rep file be opened. To make a comparison, let's say I want to automate a task of opening a specific microsoft excel file (workbook), I would want to have the microsoft excel application up and running then get the specific excel workbook that you need to have open, which is what I'm trying to get this vb script to do. The thing about excel is that you don't need to provide a password and username to open excel as an application. I tried replacing the exec path to the specific file, but it does not work because the application of Business Objects is not running. Even if Business Objects was running, it would not execute. Anything else that I should try ? Thanks.
    15 pointsBadges:
    report
  • Saravanainfo
    Hi, Thanks for the code... I tried this, it executes sucessfully but doesn't open the BO application or BO report... Any Suggestions Thanks Saravana
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following