Using BO6 and BOXi busobj.application on the same computer

Hi,

I have made a small tool which uses busobj.application object to open and refresh reports.

I’m currently using BO 6.1.3 and it’s working fine but i have now BO Xi R2 reports to handle.

I have tried to install BO Xi but the problem is, when i use busobj.application, it is opening BO Xi only and i can’t use my old BO 6.1.3 reports anymore with this tool.

Is there a way to specify which version of BO is used when using busobj.application ? and is it possible to have both and use both at the same time ?

Thanks


fvil (BOB member since 2007-11-21)

BO advice not to install different versions on a single workstation. (conflicts can occur with registry and dll’s).

I have overcome by modifying the registry key HKCR\CLSID{DCDC6F02-5766-11d0-AF14-00A0C912DCDD}\LocalServer32\ to point to the location of busobj.exe you want to use (in my case “C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\busobj.exe /Automation” or “C:\Program Files\Business Objects\BusinessObjects Enterprise 6\bin\busobj.exe /Automation”)

This may well differ in your environment.

HTH


Sushir Patel :uk: (BOB member since 2006-04-19)

Thanks for your answer.

But meanwhile I have found that if i use
CreateObject(“BusinessObjects.Application.5”)
it opens the BO v5
if i use CreateObject(“BusinessObjects.Application.6”)
it opens BO v6
and if i don’t have BO Xi
CreateObject(“BusinessObjects.Application.11”) makes an error.

But now, i have installed BO Xi, and even CreateObject(“BusinessObjects.Application.6”) opens Xi !!

Is there a way to still create a BO 6 object ??


fvil (BOB member since 2007-11-21)

What I did was to have a dropdown in my excel to indicate what version of the busobj.exe I want to use, according to this setting I would change the Registry setting accordingly see code below (Sub auto_openBO()):

'reads the value for the registry key i_RegKey
'if the key cannot be found, the return value is ""
Function RegKeyRead(i_RegKey As String) As String
    Dim myWS As Object

    On Error Resume Next
    'access Windows scripting
    Set myWS = CreateObject("WScript.Shell")
    
    'read key from registry
    RegKeyRead = myWS.RegRead(i_RegKey)
End Function

'sets the registry key i_RegKey to the
'value i_Value with type i_Type
'if i_Type is omitted, the value will be saved as string
'if i_RegKey wasn't found, a new registry key will be created
'RegKeySave also has an input parameter for the type of the Registry key value. Supported are the following types:
'REG_SZ - A string. If the type is not specified, this will be used as Default.
'REG_DWORD - A 32-bit number.
'REG_EXPAND_SZ - A string that contains unexpanded references to environment variables.
'REG_BINARY - Binary data in any form. You really shouldn't touch such entries.

Sub RegKeySave(i_RegKey As String, _
               i_Value As String, _
      Optional i_Type As String = "REG_SZ")
    Dim myWS As Object
    
    'access Windows scripting
    Set myWS = CreateObject("WScript.Shell")
    'write registry key
    myWS.RegWrite i_RegKey, i_Value, i_Type

End Sub

Function RegKeyExists(i_RegKey As String) As Boolean
    Dim myWS As Object

    On Error GoTo ErrorHandler
    'access Windows scripting
    Set myWS = CreateObject("WScript.Shell")
    'try to read the registry key
    myWS.RegRead i_RegKey
    'key was found
    RegKeyExists = True
    Exit Function
    
ErrorHandler:
    'key was not found
    RegKeyExists = False
End Function

Sub auto_openBO()
' Sub auto_open()
    Dim currValue, BO_Version As String
        
    BO_Version = Sheets("Variables").Range("B3").Value
    
    currValue = RegKeyRead("HKCR\CLSID\{DCDC6F02-5766-11d0-AF14-00A0C912DCDD}\LocalServer32\")
    
    If BO_Version = "1" And InStr(currValue, "BusinessObjects Enterprise 6") = 0 Then
         Call RegKeySave("HKCR\CLSID\{DCDC6F02-5766-11d0-AF14-00A0C912DCDD}\LocalServer32\", "C:\Program Files\Business Objects\BusinessObjects Enterprise 6\bin\busobj.exe /Automation")
    End If

    If BO_Version = "2" And InStr(currValue, "BusinessObjects Enterprise 11.5") = 0 Then
         Call RegKeySave("HKCR\CLSID\{DCDC6F02-5766-11d0-AF14-00A0C912DCDD}\LocalServer32\", "C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\busobj.exe /Automation")
    End If

    If BO_Version = "3" And InStr(currValue, "BusinessObjects Enterprise 12.0") = 0 Then
        Call RegKeySave("HKCR\CLSID\{DCDC6F02-5766-11d0-AF14-00A0C912DCDD}\LocalServer32\", "C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\busobj.exe /Automation")
    End If
    
    Set buso = CreateObject("businessobjects.application")
    ret = buso.Application.LoginAs

End Sub


Sushir Patel :uk: (BOB member since 2006-04-19)

I’ve tried that, it’s excellent and works fine … but i can’t use BO Xi anymore, even if i create a BusinessObjects.application.11
My wish would be to be able to create a Bo6 or a BoXi by only changing the CreateObject parameters


fvil (BOB member since 2007-11-21)

Oh your code is very nice …
Even if i feel quite dangerous to change the registry on the fly, if it’s the better way to do it, i’m ok :slight_smile:

Thanks !


fvil (BOB member since 2007-11-21)

How to create BO Desktop Reports using VB OR VB DOT NET coding?


2732829 (BOB member since 2009-03-06)