Sviluppo e Sviluppi
giovedì, marzo 03, 2005
 
Shell Wait
One or Two times for year, I need to use a Shell Wait function to wait for a task ended. Windows is a multitasking SO, so if you use a program to run (for example using Shell command from VBA) another one, you can need to wait the end of the second program.
Consider this Example:

Program 1

1. Select a file F
2. Run a Shell command to print file F
3. Delete File F

Program 2

Redirect F to a printer

Step 3 of program 1 must wait the end of printing before delete file F.

In this case you must wait for program 2 end.

Windows have some API to wait a task end: try to search SHELLWAIT on Google.
VBA Example:
Zip file: ShellWait Demonstration.zip
Comments: Posta un commento

<< Home

Powered by Blogger