I’m developing a reporting environment and make use of MS Access, SAS and BO (because of different reasons/politics)…they don’t allow me to use Designer, so all output comes is delivered from SAS in .xls files. Based on the .xls files I created some reports.
Question:
Can I launch BO Classic 6.5 from a VBS file and refresh some of the reports automatically in VBA…I assume the latter shouldn’t be a problem but has anyone experience with launching BO from a .vbs file?
problem…I’m writing the .VBS file and I’m having an error at the line where I’m going to login:
Dim bo, Path, SavePath
Usrnm = "user"
Pswrd = "password"
RepoName = "BOMAIN"
Path = "H:\My Business Objects Documents\userDocs"
SavePath = "C:\Dummy\"
Set bo = CreateObject("BusinessObjects.Application")
bo.LoginAs Usrnm, Pswrd, False, RepoName
The error is: “The remote server machine is uninitialized or doesn’t exist ‘LoginAs’”
What could be the problem? Am I using the wrong code?
Secondly, small remark…When launching Business Objetcs from Windows, we don’t have to login…the login screen doesn’t popup, the application is opened immediately. Although there’s a BoMain.key file on the machine so I assume the login is detected by NT authentication…Is the code for Login in by VBS different in this case?
Yes that works…it returns “True” and in my Task Manager I can see MS Excel joining the list of processes.
On the other hand, I decided to start up Business Objects from MS Access, so I can use VBA for this…I wrote a Sub and it’s already working. No need to suffer this VBS issue anymore…
Although for the challenge I’d be happy search further…maybe when you’ve recovered from beiing sick?
yes that’s true…it works from VBA and not from VBS…
…of course, it didn’t work from the first time in VBA neither, as I had to add my BO Objects Library 6.5 Reference…after this it worked perfect.
…is there something like this that has to be added/defined using VBS? Maybe we have to search in that area…I’m certainly not a VBS-expert… …excuse me when I’m saying stupid things…
no, it’s not a reference. You can’t add a reference in VBS (and no shame in not knowing VBS. Since you know VBA, you know VB, VBA,VBS,WSH and ASP since they’re basicly the same language just with some restrictions and variations)
But did you copy exactly this script in VBA ?
Of did you (since you added the reference which isn’t necessary when you use createobject()) use this sort of code:
dim bo as busobj.application
set bo = new busobj.application
dim bo
Set bo = CreateObject("BusinessObjects.Application.6")
bo.Visible=TRue
…this code returns following error:
“The object invoked has diconnected from its clients”
This code
dim bo as busobj.application
always returns an error on my machine…“Expected end of statement”…it has something to do with the “as”. When I just put “Dim bo” without “as” the error disappears :?
In VBS you don’t declare the type of variable (the as part), it’s determined at runtime what type it is.
For the error message…I don’t know what it is since you could start excel didn’t you ?
dim bo
Set bo = CreateObject("Excel.Application")
bo.Visible=TRue
You could also try if designer (Designer.Application) does work from VBS, but it doesn’t solve the problem. Only thing I can think of is that there’s something wrong with your installation and windows can’t associate the ‘BusinessObjects.Application’ with the correct type library (tlb). If you run it from VBA you set the reference at the start so it doesn’t need to find it.
…indeed I could start up Excel without problems. The same code for BO results in an ERROR…there have been serious troubles here with BO lately so I assume there’s something wrong with installations…In december they migrated from 6.1 to 6.5.
Anyway, I’m going to leave it by this…I’m using VBA to start up BO and it’s working so I don’t need this VBS solution anymore. Would be a waste of time now on my spooky pc