Run an External .exe

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible from Excel (using the buttons) to:
1) run an external .exe
2) When the .exe finishes pick up the outputs of the .exe in excel
Thanks again,
Dan
 
You can run external programs using the shell command, but as for picking up
the outputs, are they being stored somewhere or just how do you propose
getting them.
 
Jim,
Thanks,

Could you please provide an example of this "shell" command.

Wrt picking up, the .exe ouputs a text file.
Do I have a way to know when the .exe finished, ie: when this text file is
ready for pick up? I would like to do all this automatically from Excel, in
this way, I could run pre existing .exe routines, which are transparent to
me in excel and then pick up results and post process in excel.

Thx again
Dan
 
Here is how you use the shell command...

Sub RunProgram()
Shell ("C:\Windows\Notepad.exe")
End Sub

You can use a file system object to read the text file and depending you can
try using

DoEvents 'to make sure the process has completed
or
Use OnTime to specify a wait time
 
Very Nice... I never have to wait for outside apps but if I ever do this will
be handy. Thanks Tom... I was very suspicious of whether DoEvents would work.
I had my doubts...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top