Application.OnTime every Y sec with Y NON integer?

  • Thread starter Thread starter dexterslaboratory
  • Start date Start date
D

dexterslaboratory

Dear all,

my question is about the Application.OnTime Method.

Usually I use it after having these two variables defined:

Public RunWhen As Double
Public Const cRunIntervalSeconds = X

then the operation/procedure to be scheduled starts periodically when:

RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)

Doing so, I can schedule my macros every X seconds where X is an
integer.

Now I wonder whether is possible scheduling event every Y seconds with
Y decimal (e.g.: 1.2 s, 4.5 s ...).

Any suggestion?

BR,
CR
 
It's not possible using OnTime - the EarliestTime argument is rounded to
the nearest second.
 
You can do this with APIs if it is that important.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
You can do this with APIs if it is that important.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Bob,

thanks for your feedback.
I googled this matter with "APIs" as keyword and I have found this
interesting page from Chip Pearson's site:

http://www.cpearson.com/excel/OnTime.aspx

He suggests some procedures that work perfectly for my case.


BR,
CR
 
Yep, that is the sort of code that I meant.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Back
Top