Ontime method, quick question.

  • Thread starter Thread starter Tomski
  • Start date Start date
T

Tomski

Hi,

I need to run "getprice" 3 times during the day. The way I will do it
at the moment would be to use the line shown below 3 times with the
different times.

Application.OnTime TimeValue("06:00:00"), "getPrice"

I was wondering if it was possible to just use one line, kind of like
that shown below, which I know won't work, but shows what I want to
do.

Application.OnTime TimeValue("06:00:00"),TimeValue("12:00:00"),
TimeValue("16:00:00"), "getPrice"


Thanks

Tom
 
Perhaps

application.OnTime Now +
application.choose(int(int((now-int(now))*24)/6),timeserial(6,0,0),timeseria
l(12,0,0),timeserial(8,0,0),timeserial(6,0,0)), "getPrice"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Cheers for the idea, thought it looked like a possibillity, but the
thought of a diifferent way using a public (date)variable which coul
be updated after each execution of the method.


This seems to be just what I want. But thanks ever so much for th
suggestion.
 
Ah well you asked for it in one line, so that is what I set out to achieve.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Thats a good point, I should have phrased the question differently.
Still, that is something that I wanted to know and hence it will be
useful in the future.

Thanks

T
 
I know, I was only teasing.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top