Accessing a single EXE automation server from VBScript
Posted on 2005-04-07
Is it possible to launch an executeable automation server without the /Automation command line parameter, and then have an external VBScript access the exposed objects from that particular instance of the server?
Basically, I want to have an application that can be launched by the user, which is accessed and manipulated by external VBScripts. I only want one instance of the application to ever be present. If the application doesn't exist, then I want it to be automatically launched by the VBScript. The app should stay open after the VBScript has finished with it.
My current situation is that if I manually run the executable (i.e. without the "/Automation" command line parameter), and then run a VBScript to access the automation objects exposed by the application, it just starts a new instance of the application, rather than using the existing instance.
Secondly, if I run the application WITH the "/Automation" command line parameter, the VBScript is able to access the instance correctly, BUT(!) the application shuts down as soon as the VBScript has finished with it.
It's not a major problem to have to start the app with the automation flag, it's just a bit untidy. Although in which case, I need to know how to stop the app shutting down after it has finished with it.
Ideally, an answer would tell me how to do get what I want without having to use the automation flag at all.
Thanks in advance.