VBA: Switch front Application in VBA
Posted on 2006-11-05
I am trying to send some information from MS Access to another application (Cumulus) and then have that application display data related to the information.
The Cumulus Application used to be fully VB scriptable but has since a few years switched to JAVA instead. However, it does have one single Object in it's VB Dictionary: The Application object, and this one supports only ONE Function (which allows me to have it start one of its JAVA plug-ins, called EJPs and pass some data to it)
I am succesful in using the command to send the data to Cumulus, and if Cumulus is not already running, it will launch and come to the front and then execute my command (by executing my JAVA plug-in with the data that was sent from Acceess)
HOWEVER: If Cumulus is already running, it will NOT come to the front and the user will therefore not see the result.
My Question: How can I either force MS Access to the background or bring Cumulus to the foreground? Is there a general command in VBA that would allow this?
For reference, here is the simple code snippet in Access:
Private Sub Command0_Click()
Set cuApp = CreateObject("Cumulus6.Application")
reply = cuApp.CallEJP("com.modula4.testing.MainEJP", "Hi")