+ Reply to Thread
Results 1 to 3 of 3

Time-Triggered Macros

  1. #1
    Registered User
    Join Date
    09-16-2013
    Location
    Austin, Texas, USA
    MS-Off Ver
    Excel 2007 Home
    Posts
    17

    Time-Triggered Macros

    How would I have a macro run at a certain time or at certain times without having it occupied with constantly polling the clock?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Time-Triggered Macros

    check out the OnTime method
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-16-2013
    Location
    Austin, Texas, USA
    MS-Off Ver
    Excel 2007 Home
    Posts
    17

    Re: Time-Triggered Macros

    I read quite a few write-ups on the OnTime Method, a method to which I had had a brief and vague exposure but about which I had forgotten. Most of the write-ups offered little more than the correct syntax and a couple of examples. One of them stated that it could be used for the periodic execution of a subroutine without offering anything regarding how. Over the years I've come to expect glaring omissions in "free" information from Microsoft, but it seems that a disturbingly high percentage of techs may be following their lead. In their defense, I suppose they get at least as frustrated with Microsoft as I do. It was not until I came across a write-up that explained scheduling the initial trigger from a subroutine named workbook_open() and scheduling each subsequent trigger from within the scheduled subroutine that it all clicked. My workbook now does exactly what I want it to do. I got it to run MySub (name changed) every quarter-hour on the quarter-hour by including the following line in both workbook_open and MySub:
    Application.OnTime WorksheetFunction.RoundUp(Now * 96, 0) / 96, "MySub"
    Many thanks for steering me in the right direction!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to fix time with macros
    By osamajamal in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-24-2013, 03:46 AM
  2. Time-Triggered Cell Copy/Paste
    By gandolff in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-01-2009, 07:04 AM
  3. How to stamp live time and run a timer after triggered by an event?
    By pkaspa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2008, 01:21 PM
  4. Run two macros in the same time.
    By emil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2006, 02:45 PM
  5. Runing two macros triggered by a button
    By JackR in forum Excel General
    Replies: 3
    Last Post: 12-08-2005, 08:55 PM

Tags for this Thread

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