Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Schedule Macro doesn't seem to run any suggestions

Below is a scheduled macro to run everyday at 5:00 am. It doesn't seem to be
working. Does anybody know how to fix?

Sub Schedule()
Application.OnTime EarliestTime:=TimeValue("5:00 AM"),
Procedu="RefreshDaily", Schedule:=True
End Sub

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Schedule Macro doesn't seem to run any suggestions

On Dec 24, 11:10*am, jk9533 wrote:
Below is a scheduled macro to run everyday at 5:00 am. *It doesn't seem to be
working. *Does anybody know how to fix?

Sub Schedule()
* * Application.OnTime EarliestTime:=TimeValue("5:00 AM"),
Procedu="RefreshDaily", Schedule:=True
End Sub

Thanks


You need the date as well as the time:
Application.OnTime EarliestTime:=Date + TimeSerial(5, 0, 0) + 1
will schedule the next run tomorrow

gsnu2007k
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Schedule Macro doesn't seem to run any suggestions

To have it run everyday do I still need the "+1"

" wrote:

On Dec 24, 11:10 am, jk9533 wrote:
Below is a scheduled macro to run everyday at 5:00 am. It doesn't seem to be
working. Does anybody know how to fix?

Sub Schedule()
Application.OnTime EarliestTime:=TimeValue("5:00 AM"),
Procedu="RefreshDaily", Schedule:=True
End Sub

Thanks


You need the date as well as the time:
Application.OnTime EarliestTime:=Date + TimeSerial(5, 0, 0) + 1
will schedule the next run tomorrow

gsnu2007k

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Schedule Macro doesn't seem to run any suggestions

If you include the line in RefreshDaily, It schedules the next entry
for tomorrow.

So the +1 is necessary!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro does not work in Office 2007... suggestions: jatman Excel Discussion (Misc queries) 2 June 13th 08 12:11 AM
Macro for creating a schedule Marta Excel Discussion (Misc queries) 0 July 17th 07 04:04 PM
Schedule a Macro to run every 5 minutes Atheobody Excel Discussion (Misc queries) 6 September 9th 06 06:13 PM
Schedule an Excel macro ledzepe Excel Discussion (Misc queries) 2 August 4th 06 07:20 PM
Schedule a macro running okanem Excel Discussion (Misc queries) 2 July 4th 05 01:52 PM


All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"