Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling BO from Excel 2

Status
Not open for further replies.

Cage

MIS
Aug 25, 2002
50
CA
I am trying to change BO filters / variables in from Excel. Is it possible to load a BO library containing BO objects e.g ActiveReport. TIA
 
yup - just set a reference to it in your references (in the VBE Tools>References) and then use something like

dim BOBJApp as BusinessObjects.Application



Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Now that I have the library, I guess I would use Getobject() to choose which open BO application to use. If so do I need to HWND to determine which BO application or am I able to type the Title of the open BO application.

E.g

Dim BOBJApp as Busobj.Object
Dim myreport as Report

BOBJApp = getobject("","Busobj.application")
myreport = BOBJApp.ActiveReport

 
I don't normally try and get pre-opened sessions - normally create my own and open the report inside it - the following opens BOBJ, opens a report, refreshes it then loops through each tab in the report and uses CopyAll to get the data into excel....
Code:
Dim BoApp As busobj.Application, BODoc As busobj.Document, BORep As busobj.Report
Set BoApp = CreateObject("BusinessObjects.application")
With BoApp
    .LoginAs "userid", "password"
    .Visible = True
    .Documents.Open ("Full\File\Path\And\Name.rep")
    With .ActiveDocument
        .Refresh
        i = 1
        For Each rpt In .Reports
            rpt.Activate
            BoApp.CmdBars(2).Controls("&Edit").Controls(20).Execute
            Sheets(i).Range("A1").PasteSpecial Paste:=xlPasteValues
            i = i + 1
        Next
    End With
End With

Set BoApp = Nothing
Set BODoc = Nothing

If you do need to get a specific session then I would guess that you do need the HWND

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks Xlbo, this is very useful. Ideally I would like to control a BO application that is already open.

I tried using
set BOApp = Getobject(,"BusinessObjects.application")

However I am receiving a 'Runtime 429 - ActiveX component
cannot creat'

CreateObject works, GetObject does not work, any ideas?
 
try: set BOApp = Getobject(,"BusObj.application")

think my syntax was a little out in my 1st reply...


Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Same 429 error. It is strange how CreateObject works but GetObject does not, do they not use the same registry?

Are there any alternative which would allow me to control an open BO application. The reason for this is because the BO file is very large and takes a while to open and would prefer to control an open BO app rather than load up a new one.
 
hmmmm - I get the same error - whether I use BusObj or BusinessObjects and whether I dim as Object or as BusObj.Application or as BusObj.Application.......vert odd

Help file seems to think it may be with registering licenses and linking to DLLs but given that it happens on both my version and yours, I would suggest this is an object model issue in the Bus Obj SDK (not exactly unheard of !)

Unless anyone has a better idea, I'm afraid you may be stuck with CreateObject.....

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Using the following code from earlier in the thread:

BoApp.CmdBars(2).Controls("&Edit").Controls(20).Execute

it is not Copy All from BO. Could this be because I am using BO version 6.1?
 
could well be yes - we are stuck with v5.1.8

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top