Call business objects

jtodd

Board Regular
Joined
Aug 4, 2014
Messages
194
Hi , I am calling bo from an access database with the following code
Private Sub Label15_Click()
Dim BOApp As busobj.Application
Dim Doc As busobj.Document
Dim Rpt As busobj.Report
Set BOApp = New busobj.Application
BOApp.Visible = False
Call BOApp.LoginAs("logon", "password", True)
Set Doc = BOApp.Documents.Open("S:Jim Todd\Intransit\Outstanding TN's.rep")
'Doc.Variables("date").Value = Format(Date - 92, "dd/mm/yyyy")
BOApp.Interactive = False
Doc.Refresh
'BOApp.Interactive = True
For Each Rpt In Doc.Reports
Call Rpt.ExportAsText(Doc.Path & "\" & Rpt.name)
Next Rpt
BOApp.Quit
Set BOApp = Nothing
On Error GoTo 0
DoCmd.RunMacro "Macro1"
Exit Sub
err:
MsgBox "917 update failed"

End Sub

Which works fine but even when I enter valid username and password I still get the bo logon screen (with the data filled in )but I still have to click ok,
I need to automate this procedure so need BO to open without any intervension (do not have to click ok) so bo opens runs the report saves it and closes automatically .
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Not sure anyone will be able to solve given that we can't see the code after this call: BOApp.LoginAs("logon", "password", True). Appears you're passing the values to something that requires a button click in the BO app. I'm guessing you can't modify the BO in anyway. If not, maybe you can use SendKeys to the BO to cause the button click. I've never used SendKeys in Automation.

If the BO's opening routine will allow you to code for a switch, you can pass a custom switch from Access in your path. For example, in one of my projects I had to tell Access that it's a PC opening the database and not a person. The command line ended with /Otto Mayshun (bad joke, right?). This passes the switch to Access to the Command property. Wondering what you BO is and whether or not you can bypass the login form in the same manner.
 
Upvote 0
Thanks for your help , I will get on to our BO team and see if they can sort it for me.



Not sure anyone will be able to solve given that we can't see the code after this call: BOApp.LoginAs("logon", "password", True). Appears you're passing the values to something that requires a button click in the BO app. I'm guessing you can't modify the BO in anyway. If not, maybe you can use SendKeys to the BO to cause the button click. I've never used SendKeys in Automation.

If the BO's opening routine will allow you to code for a switch, you can pass a custom switch from Access in your path. For example, in one of my projects I had to tell Access that it's a PC opening the database and not a person. The command line ended with /Otto Mayshun (bad joke, right?). This passes the switch to Access to the Command property. Wondering what you BO is and whether or not you can bypass the login form in the same manner.
 
Upvote 0

Forum statistics

Threads
1,214,825
Messages
6,121,788
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top