Starting and stopping Ontime

E

EW

I am currently running Ontime to run a macro every hour. The project that I
am running this for opens at 8a and closes at 9p. Is there a way to insert a
If/Then statement that would state...If the time is between 8 and 21:00 then
run update_line_currentday, else end sub.???

I would like to palce this code inside the macro that Ontime is trying to
run so that Ontime will remain running in the off time.

Thanks for any help in advance!
 
M

mudraker

EW

try


If TimeValue(Now()) < TimeValue("08:00") _
Or TimeValue(Now()) > TimeValue("21:00") Then
Exit Sub
End If

or


Select Case Hour(Now())
Case Not 8 To 21
Exit Sub
Case Else
Stop
End Selec
 

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

Top