View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Steve Steve is offline
external usenet poster
 
Posts: 1,814
Default Is there any way to start (and later quit) an EXE file.

Thanks Steve
We are using WinXP. The reason I would like to quit at some point is to
regain complete control of XP and lose barcode scanner control. We then use
excel to load the data into a database that cannot at this point be
controlled by the Scanner.
We are using VNC.exe as the executable, which puts the top left corner of
excel on the scanner screen.


"Steve Yandl" wrote:

Steve,

You can use the Shell function to launch an executable file but you don't
retain control of it which means you can't shut it down from within your VBA
code. Typically, you would use the Windows API to shut down the application
which is somewhat cumbersome but not impossible.

If you're not using this on any systems with Win98 or earlier, there is an
option using WMI. Basically, you launch the application and capture the
process ID value at the same time and then use a second WMI routine to kill
the process with that PID. Let us know if this situation applies.

Steve Yandl




"Steve" wrote in message
...
I am trying to start the following program when I activate a
page."C:\Program
Files\RealVNC\vncviewer.exe" -listen

The purpose is to use a barcode scanner and load data into excel. The
above
program has to be resident in the Tray for the scanner to load data into a
data page. Later I would like to unload or quit the EXE file to let excel
get
control back. Any thoughts would be greatly appreciated.
Thanks
Steve