PC Review


Reply
Thread Tools Rate Thread

How can you wait for the SHELL command to terminate ?

 
 
jmoffat
Guest
Posts: n/a
 
      29th Sep 2003
As the help file points out:

"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."

This implies there is a way to cause execution to halt until the shell
command is completed.

Has anyone found a way to do this ?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      30th Sep 2003
MS has a solution at:

http://support.microsoft.com/?kbid=214248
XL2000: How to Force Macro Code to Wait for Outside Procedure

Here's a link to a nice ShellAndWait function that does that.
http://groups.google.com/groups?thre...%40tkmsftngp03

jmoffat wrote:
>
> As the help file points out:
>
> "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."
>
> This implies there is a way to cause execution to halt until the shell
> command is completed.
>
> Has anyone found a way to do this ?
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~ View and post usenet messages directly from http://www.ExcelForum.com/


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
jmoffat
Guest
Posts: n/a
 
      1st Oct 2003
Thanks a lot Dave - this is exactly what I was looking for.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell and Wait Sreedhar Microsoft Access VBA Modules 3 25th Nov 2007 01:54 AM
How to terminate process started using the Shell function John Bradley Microsoft VB .NET 2 28th Aug 2007 04:47 AM
Wait for Thread normally terminate =?Utf-8?B?amVmZg==?= Microsoft Dot NET Compact Framework 3 8th Mar 2007 09:15 PM
Wait until Shell command is finished (ftp example) George A Microsoft Access VBA Modules 3 10th Sep 2004 06:03 PM
Command Shell Window Setting - Prevent Close on Terminate? =?Utf-8?B?Qm9iIEtsdWNraG9obg==?= Windows XP General 2 5th Sep 2004 12:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:38 AM.