How to know when an external program ended?
Hello to all, this is my first post in this forum. Ok here we go....I need a little help with this problem
***********************************
Dim Value
Value = Shell("xxxxxx.exe", vbNormalFocus)
'***********************************
The above line is used by me to call up an external program call "xxxxxx.exe". What this program does is process some results, and output the result to a data file, and closed itself.
The content of the file will be read in the subsequent lines.
----------------------------------------------------------
Note: By default, the Shell function runs other programs asynchronously. This means that a program started with Shell might not finish executing before the statements following the Shell function are executed. ~taken from MSDN
---------------------------------------------------------
Now my question to fellow VB experts are, how in VB codes can I know when the program closes. I need to run the next line only after the program closed. It is important cuz the next line has a high chance of running even before the data file is generated. The data file must be generated before the next line can be run. Hope u guys can help. Thanks.