Question : activex can't create object solution, ahhh

Hello guys,
I have the below script that I'm running on my work PC, I have had my computer replaced and now I get the above error trying to run my VBA script in Access. The code highlights the code

Set BoApp = CreateObject ("BusinessObjects.application")

I have been trying everything I can find for the past 2 days to fix this, I've looked at a lot of forums and people seem to figure it out but never really post how.

I have unregistered and registered the following references in VBA:
Microsoft ActiveX Data Objects 2.1 Library
Microsoft DAO 3.6 Object Library
BusinessObjects 6.5 Object Library

Business objects is installed on my Local PC in program files,
Can anyone think of anything???

Thanks
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Sub irb_data_update(boname As String, bopwd As String)
 
Dim BoApp As busobj.Application
Dim BODoc As busobj.Document
Dim BORep As busobj.Report
Dim boDP As busobj.DataProvider
 
    Set BoApp = CreateObject("busobj.Application")
 
        With BoApp
         .LoginAs boname, bopwd, False
         .Visible = True
         .Documents.Open (DumpPath & "ledger_irb.rep")
             With .ActiveDocument
                  .Refresh
             End With
        End With
 
Set BODoc = BoApp.ActiveDocument
Set boDP = BODoc.DataProviders.Item(1)

Answer : activex can't create object solution, ahhh

I take it it has been added as a reference?
I say this because of this line

Dim BoApp As busobj.Application

(in vba editor, go to Tools/References)

Now since you have defined it like this and so are using early binding, why dont you just perform a new instead of create object?

set BoApp = New busobj.Application


also do a debug/compile and ensure you add

option explicit

on the top of your code module before doing a debug/compile
Random Solutions  
 
programming4us programming4us