Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with ONTIME

Status
Not open for further replies.

snorky

Programmer
Jun 5, 2001
58
GB
Hello All,
I have written an Excel add-in that uses Application.ontime to schedule a future run of a macro. This works fine as long as the time doesn't exceed 24hrs. If, say,it's Friday and I want to run the macro on Monday ,I start my program and it sits and waits till Saturday and then runs the macro at the correct time but the wrong DAY ???? Any ideas , is this a limitation of application.ontime ?

Thanks Snorky [pc2]
 
Why not do a test to see what the current day is (Worksheetfunction.weekday)
If weekday <> Friday then
wait 24 hours
else
wait longer
end if

HTH Rgds
~Geoff~
 
Thanks for the idea . I had hoped that the ontime function would work like that , but it seems that I'll have to code my way round this . Thanks anyway !

Snorky [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top