Opening an external application

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I would like to write some code to automate some manual
tasks which I undertake.

If possible the code would reside within Access.

The tasks are:
i) Open an another application that resides on my PC
(ri.exe)
ii) Once opened I want to select the "Update" menu that
appears at the top of the page.

Can someone tell me what code I need in order to achieve
this. There are another couple of steps after, however, I
want to get this part working before concentrating on the
next bit.

Thanks in advance

Steve
 
Hi Steve

This can be accomplished using the Shell and SendKeys commands. I'm not sure
about what app you wish to run, so I'm including the code that will run the
Calc.exe application.

This is an example obtained from a Microsoft helpfile

------------------ Microsoft example per help file ----
This example uses the Shell function to run the Calculator application included
with Microsoft Windows.It uses the SendKeys statement to send keystrokes to add
some numbers, and then quit the Calculator. The SendKeys statement is not
available on the Macintosh. (To see the example, paste it into a procedure,
then run the procedure. Because AppActivate changes the focus to the Calculator
application, you can't single step through the code.)

Dim ReturnValue, I
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
AppActivate ReturnValue ' Activate the Calculator.
For I = 1 To 100 ' Set up counting loop.
SendKeys I & "{+}", True ' Send keystrokes to Calculator
Next I ' to add each value of I.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator.


Hope this helps

Maurice St-Cyr
Micro Systems Consultants, Inc
 
Back
Top