Determine When A Executable Program Completes

G

Gary

I have started a executable program using the Shell command.

I actually started acrobat to convert a .pdf file into .jpg files. This was
accomplishing using VBA code. I need to start another VBA process, but it
needs to know when the acrobat process has completed.

Once I determine the acrobat process has completed, I would like to close
acrobat and start another VBA process.

Can someone help.

Thanks
 
R

Robert Morley

This is actually harder than you'd think. The less-elegant way of doing it
is to loop after your Shell statement until you can successfully rename your
..jpg file, at which point your converter has released its lock, therefore
it's probably done.

The best way to do it is documented in the MS Knowledge Base, article
209876: http://support.microsoft.com/default.aspx?scid=kb;en-us;209876



Rob
 
D

Dirk Goldgar

Gary said:
I have started a executable program using the Shell command.

I actually started acrobat to convert a .pdf file into .jpg files.
This was accomplishing using VBA code. I need to start another VBA
process, but it needs to know when the acrobat process has completed.

Once I determine the acrobat process has completed, I would like to
close acrobat and start another VBA process.

See if API code at this link helps:

http://www.mvps.org/access/api/api0004.htm
API: Shell and Wait
 
Top