Application.Ontime Did not run ...why not?

ilcaa

Well-known Member
Joined
May 25, 2005
Messages
751
Office Version
  1. 365
Platform
  1. Windows
I am trying to have a Macro run at 10am, then run the macro every 15 minutes in order to update data...

I read thru some posts and some online guides and followed it step by step but this afternoon when I returned to my office the macro never ran(excel opened and selected)...

Here are all the SUB() i created. Can someone help me identify where I went wrong and what I need to adjust. Again, I want to start at 10am and run every 15 minutes until 5pm (i never included the end at 5pm but would like to)


' these Private Subs I placed in the "This Workbook" .....

Private Sub WorkBook_Open()

Application.OnTime TimeValue("10:00:00"), "Index_Analysis"

End Sub
----------------------------
Private Sub workbook_BeforeClose(Cancel As Boolean)

Application.OnTime dtime, "Index_Analysis", , False

End Sub
----------------------------
Private Sub WorkBook_Open()

Application.OnTime Now + TimeValue("00:15:00"), "Index_Analysis"

End Sub
----------------------------

' following the instructions i placed these commands under my macro, "Index_Analysis", then the code under these commands...

Sub Index_Analysis()

dtime = Now + Now + TimeValue("00:15:00")
Application.OnTime dtime, "Index_Analysis"

Application.OnTime
TimeValue ("10:00:00"), "Index_Analysis"

' my macro code to run Index_Analysis entered here


thanks if anyone can point out the error...
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I can send the file to make it easier as well, thanks...
 
Upvote 0

Forum statistics

Threads
1,215,529
Messages
6,125,345
Members
449,220
Latest member
Edwin_SVRZ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top