Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Time Delay in VBA

Is there a way to create a time delay in a macro. I would like excel to
wait, say 5 minutes, while an external script triggered by that same macro
finishes running.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Time Delay in VBA

Hi
have a look at
wait
in the vBA help

--
Regards
Frank Kabel
Frankfurt, Germany

"John Tolman" schrieb im
Newsbeitrag ...
Is there a way to create a time delay in a macro. I would like excel

to
wait, say 5 minutes, while an external script triggered by that same

macro
finishes running.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Time Delay in VBA


VBA offers two ways.

have a look at Application.OnTime
to schedule a "PostExternalProcess " macro to start
at a specified time.(which allows the user or any other code to run while
you wait for the time to elapse...)

dim dtOnTime as date
dtOnTime = now+timeserial(0,5,0)
application.ontime dtOnTime,"MyPostProc"

(you'll need the variable to be able to reschedule or cancel it)

Or just completely freeze Excel..
(Just allow external apps with)
Application.wait now+timeserial(0,5,0)

There's some api functions as well,
but probably beyond the current scope.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"?B?Sm9obiBUb2xtYW4=?="
wrote:

Is there a way to create a time delay in a macro. I would like excel
to wait, say 5 minutes, while an external script triggered by that
same macro finishes running.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Time Delay in VBA

John,

Maybe...
"How To Use a 32-Bit Application to Determine When a Shelled Process Ends"
http://support.microsoft.com/?kbid=129796

Regards,
Jim Cone
San Francisco, CA

"John Tolman"
wrote in message ...
Is there a way to create a time delay in a macro. I would like excel to wait,
say 5 minutes, while an external script triggered by that same macro finishes running.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
time delay refresh on random number Bertrand[_2_] Excel Worksheet Functions 2 January 27th 10 01:00 AM
Time Delay for Macros [email protected] Excel Discussion (Misc queries) 1 May 15th 07 02:42 PM
Long Time Delay To Paste From UserForm To Sheet Minitman Excel Worksheet Functions 7 December 6th 05 12:30 AM
Copy/Time Delay Mike Excel Programming 6 October 19th 04 02:26 PM
Time Delay Kilcup[_9_] Excel Programming 3 July 2nd 04 03:39 PM


All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"