ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   OnTime (https://www.excelbanter.com/excel-programming/390050-ontime.html)

Gordon Humphreys[_2_]

OnTime
 

I'm drafting a macro by which I want to repeat at intervals of 59 secs
another macro 'TimedOut' so have:

Application.OnTime Now + TimeValue("00:00:59"), "TimedOut"

which works fine. Except even if the worksheet is closed, it reloads
itself and continues [until Excel is closed]. The MS help and the
textbooks say add a line with the same text but ending False ie
Application.OnTime Now + TimeValue("00:00:59"), "TimedOut",False

but that seems to have no effect. Grateful for any suggestions


*** Sent via Developersdex http://www.developersdex.com ***

Dave Peterson

OnTime
 
Chip Pearson explains how to use application.ontime:
http://www.cpearson.com/excel/ontime.htm

Take particular note of the way Chip uses a public variable (runwhen) to kill
the next scheduled run.

Gordon Humphreys wrote:

I'm drafting a macro by which I want to repeat at intervals of 59 secs
another macro 'TimedOut' so have:

Application.OnTime Now + TimeValue("00:00:59"), "TimedOut"

which works fine. Except even if the worksheet is closed, it reloads
itself and continues [until Excel is closed]. The MS help and the
textbooks say add a line with the same text but ending False ie
Application.OnTime Now + TimeValue("00:00:59"), "TimedOut",False

but that seems to have no effect. Grateful for any suggestions

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson


All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com