+ Reply to Thread
Results 1 to 2 of 2

On Time Function

  1. #1
    Bill
    Guest

    On Time Function

    Hello All,
    I want to run a procedure every x minutes. To test this, I am using the
    following:

    Application.OnTime EarliestTime:=Now + TimeValue("00:00:10"),
    procedure:="SeeifTimeisPass"

    Then I have a sub:

    Sub SeeifTimeisPass
    msgbox "Hi"
    end sub

    It runs through one time, but then does not reschedule to run again (running
    every 10 seconds in this example). Any ideas why.

    Thanks,.



  2. #2
    Chip Pearson
    Guest

    Re: On Time Function

    OnTime only runs the code once. You have to reschedule the OnTime
    method each time. See www.cpearson.com/excel/ontime.htm for
    example code.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Bill" <bill@bpiconsulting.com> wrote in message
    news:2_hvf.3269$%W1.3132@newsread2.news.atl.earthlink.net...
    > Hello All,
    > I want to run a procedure every x minutes. To test this, I am
    > using the following:
    >
    > Application.OnTime EarliestTime:=Now + TimeValue("00:00:10"),
    > procedure:="SeeifTimeisPass"
    >
    > Then I have a sub:
    >
    > Sub SeeifTimeisPass
    > msgbox "Hi"
    > end sub
    >
    > It runs through one time, but then does not reschedule to run
    > again (running every 10 seconds in this example). Any ideas
    > why.
    >
    > 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