+ Reply to Thread
Results 1 to 2 of 2

Help with Application.OnTime

  1. #1

    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.


  2. #2
    Tom Ogilvy
    Guest

    RE: Help with Application.OnTime

    Have SaveFile call Task2 and so on.

    --
    Regards,
    Tom Ogilvy



    "[email protected]" 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.
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1