How to close BUSOBJ using BOSDK

Hello,
Report changes were automated using BOSDK. Even after setting
objBO (Business objects process) to nothing, BUSOBJ.EXE process is not getting closed. How can I automatically close this process? objDES (Designer process) used to close when objDES.quit is used.
Thanks in advance,
Anuradha


Anuradha Narasinga Rao (BOB member since 2002-08-19)

Are you running the process from within BusObj? Or are you driving BusObj from some external process?

If you’re running your code from inside of BusObj, I have seen all sorts of problems trying to “quit” the application with VBA. Mainly because the app quits and then throws an exception because as it is quitting, it tries to execute the next line of VBA code. Since it’s not there, it can’t be executed.

If you’re running your code from outside, then I would think that .quit or .close or something along those lines should work. Check the object model for the appropriate call.

Dave


Dave Rathbun :us: (BOB member since 2002-06-06)

Dave,
It is running from VB exe. I use objBO.quit and also Set objBO = nothing.
Still the process is not getting closed.
Thanks,
Anuradha


Anuradha Narasinga Rao (BOB member since 2002-08-19)

So what you are saying is that the busobj.exe process is still hanging around?

Dave


Dave Rathbun :us: (BOB member since 2002-06-06)

Dave,
Yes, it is still hanging around. It is 21308K.
Anuradha


Anuradha Narasinga Rao (BOB member since 2002-08-19)

This is probably naive on my part, but what about Application.Quit ? :roll_eyes:


Bill Frillman (BOB member since 2002-07-12)

Bill: that would probably work if the object is defined as an “application” in the calling VB code. But it may be that they’re using a CreateObject() call. I don’t know how that works; I’ve not done a lot of VB, just VBA.

There are some samples on the SDK support site; I just haven’t had time to take a look and see if any of them have this logic as an example to follow.

Dave


Dave Rathbun :us: (BOB member since 2002-06-06)

Dave,Bill,
The code is here. I will be glad if the error is pointed to.
Thanks,
Anuradha

Sub ChangeUnvNReport()
Dim strCurrentFile As String
Dim ObjBO As New busobj.Application
Dim docMyDocument As busobj.Document
Dim j As Integer
Dim dpMyDataProvider As DataProvider

strCurrentFile = "d:\test.rep"

    
    'login to Business objects
    Set ObjBO = CreateObject("BusinessObjects.Application.5")
    Call ObjBO.LoginAs("supervisor", "supervisor", False, "BOMain")
    Set docMyDocument = ObjBO.Documents.Open(strCurrentFile)

    For j = 1 To docMyDocument.DataProviders.Count
        Set dpMyDataProvider = docMyDocument.DataProviders.Item(j)
        If dpMyDataProvider.GetType = "DPQTC" Then
            Call dpMyDataProvider.ChangeUniverse(ObjBO.Universes.Item(SurveyName))
        End If
    Next j  ' Next data provider, if any more

    docMyDocument.Refresh
    docMyDocument.Save
    ObjBO.ActiveDocument.Close
    Set docMyDocument = Nothing
    ObjBO.Quit
    Set ObjBO = Nothing

    
End Sub

Anuradha Narasinga Rao (BOB member since 2002-08-19)

we are using the following code
Set objFileSystem = Nothing
objDoc.Close
objApplication.Quit

The busobj.exe ends most of the time. We have found that if we execute more than 1 at a time it leaves one hanging around and we manually kill it. We haven’t taken the time to research the problem or open an issue. We just single thread the jobs.


Michele Pinti (BOB member since 2002-06-17)

Michelle Pinti,
Thanks for the help. Could I know what objFileSystem object would be, I assume objApplication would be busobj.Application.
Thanks,
Anuradha


Anuradha Narasinga Rao (BOB member since 2002-08-19)

Yes,
Dim objApplication As New busobj.Application

I didn’t need to include objFileSystem it is not relevent, it is used for a log file:
Dim objFileSystem As New Scripting.FileSystemObject
… objFileSystem.CreateTextFile(strLogFilePath & strLogFileName, True)


Michele Pinti (BOB member since 2002-06-17)

Michelle Pinti,
I put in those statements but still the same problem continues…
Thanks,
Anuradha


Anuradha Narasinga Rao (BOB member since 2002-08-19)

Dear Anuradha,

Searching for my own problem, I found your question…
Declaring the ObjBO variable As “New busobj.Application” creates an instance of BusinessObjects application.
Later in the code
Set ObjBO = CreateObject(“BusinessObjects.Application.5”)
creates another instance. At the end you close ObjBO, which closes one of the instances, but doesn’t close the second one.

Regards,
Minka Tinkova
eVolition Australia
www.evolition.com.au


eVolition :australia: (BOB member since 2002-09-01)

In the SDK class at the user conference, they strongly recommend that you create your instance at the application level. That way you can only create one… :mrgreen:


Eileen King :us: (BOB member since 2002-07-10)

You will keep the line
Dim objBO as busobj.Application
It declares the object variable. Just skip the word “New” if you intend to have:
Set objBO = CreateObject(“BusinessObjects.Application”)
Because “New” creates the variable and instanciates it at the same time.
Dim objBO as New busobj.Application is the same as

Dim objBO as busobj.Application
Set objBO = New busobj.Application

And the last one is the same as
Set objBO = CreateObject(“BusinessObjects.Application”)

You probably have read about early and late binding of object variables.
Dim objVar as New Class is early binding, it declares a variable and sets it to a new class instance at the same time, before the code is executed, even if it is not executed.
Dim objVar as Class
Set objVar = New Class is late binding, it creates obj variable, but the instance is created when the code is executed.

Regards,
Minka Tinkova
eVolition Sydney
www.evolition.com.au


eVolition :australia: (BOB member since 2002-09-01)

Hi Anuradha, Well, I am facing the same problem that you have logged. I tried all means…My application actually starts 6 processes and they hang in there until the last one finishes the processing and then die. I think the QUIT and CLOSE functions dont seem to destroy the BUSOBJ.EXE on every occasion.

DO let me know if you find anything reagarding this.

Thanks


boconsultant (BOB member since 2002-10-07)

Help please!!! :wah:

I’m facing something similar to this error and I don’t know to solve it. The problem is that I can launch BO from a VB application. After open BO, the user can close the VB application and BO instance is automatically closed. The problem appears if when the user closes the VB app, BO has the Query Panel opened. Then, BO crashes (BUSOBJ.EXE application error), and I don’t know how to avoid this error. :crazy_face:


Schuster :united_arab_emirates: (BOB member since 2002-08-29)