BusinessObjects Board

Visual Basic to Copy BusObj results to Excel

[Moderator Note: Moving to SDK.]
I have a Visual Basic routine started, but I need to know the commands to “copy all” in the BusObj and open a pre-designed Excel worksheet and paste in the copied material. So the code would look like:

Begin Subroutine
Edit -Copy All
Open the Excel File
Go to row 1 column 1 of Excel File
Paste
End Subroutine

But I don’t know the Visual Basic commands. Would anyone have knowledge of what the code might be?


JackMarks :us: (BOB member since 2003-10-23)

You will find macros already written on the sample code section

Here is the link


reemagupta (BOB member since 2002-09-18)

Thank you for the response. I already have a function in BusObj 6.0 to change my report to Excel, and it does not do what I would like to do. I would rather write my own code to do the job.

I can’t find any of the sample Visual Basic code you are referring to. I would rather have examples of code. Visual Basic code. Maybe they are on the place you referred me to, but I was unable to find them.


JackMarks :us: (BOB member since 2003-10-23)

There is no “Copy All” method in the Reporter object model. It is possible to simulate it by executing the equivalent menu command, but it is quite problematic … do a search here on BOB for “cmdbars execute” (without quotes) for a number of previous discussions.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Thank you for the reply. The Visual Basic code seems to be very complex, so I believe I will go another avenue; maybe just copy the BO report by hand to Excel, and run a macro in Excel to clean it up.


JackMarks :us: (BOB member since 2003-10-23)

Just for your consideration, another approach is demonstrated here. Again, it may be overkill, but I wanted to mention it for completeness.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

The image link does not seem to be working.


JackMarks :us: (BOB member since 2003-10-23)

You’ll have to explain a bit more clearly what you mean, because it seems to work just fine for me.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Now I see it. I was clicking on the wrong object. Thanks.


JackMarks :us: (BOB member since 2003-10-23)

hmm, maybe using vba and the reportstructureitem / cellstructure / blockstructure. but i remember in version 5 there are problems in the objectsmodel.

another problem ist to save the report (the tab) as an ascii file using vba and load this file in exel.

but in both variations u have to write some code lines … (and maybe to static).


qmark :de: (BOB member since 2005-08-22)