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.
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,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.
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)
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)
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
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…
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
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.
Im facing something similar to this error and I dont 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 dont know how to avoid this error.