Help with Application.OnTime
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. |
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. |
All times are GMT +1. The time now is 04:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com