View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Help with Application.OnTime

Have SaveFile call Task2 and so on.

--
Regards,
Tom Ogilvy



" wrote:

Hi,

I am writing an Excel macro that has a sequence of 5 tasks to complete.
Each task is completed by saving a file. Now, I want the processing for
the second task to start only after the first task's output file has
been saved.

' Task 1
::::
::::
Application.OnTime Now + TimeValue("00:10:00"), SrcFlPath + DataFlName
+ "!Module1.SaveFile"

' Task 2
:::::::::
::::::::
where the SaveFile subroutine saves an output file in the target
location and closes the output file for each task.

Currently, since the file is saved after 10 minutes time, the second
task's processing starts without waiting for the output file to be
saved and the first task completed. How can I ensure that the second
task starts only after first task's file has been saved?

Thanks.