I am using the subs:
Sub MySub()
Call OtherSub
Application.OnTime Now + TimeValue("00:15:00"
, "MySub"
End Sub
Sub OncePerHour()
Application.OnTime TimeValue("08:59:00"
, "OtherSub"
Application.OnTime TimeValue("09:59:00"
, "OtherSub"
Application.OnTime TimeValue("10:59:00"
, "OtherSub"
Application.OnTime TimeValue("11:59:00"
, "OtherSub"
Application.OnTime TimeValue("12:59:00"
, "OtherSub"
Application.OnTime TimeValue("13:59:00"
, "OtherSub"
Application.OnTime TimeValue("14:59:00"
, "OtherSub"
Application.OnTime TimeValue("15:59:00"
, "OtherSub"
Application.OnTime TimeValue("16:57:00"
, "OtherSub"
Application.OnTime TimeValue("16:59:00"
, "OtherSub"
Application.OnTime TimeValue("17:59:00"
, "OtherSub"
Application.OnTime TimeValue("18:59:00"
, "OtherSub"
Application.OnTime TimeValue("19:59:00"
, "OtherSub"
Application.OnTime TimeValue("20:59:00"
, "OtherSub"
Application.OnTime TimeValue("21:59:00"
, "OtherSub"
Application.OnTime TimeValue("22:57:00"
, "OtherSub"
Application.OnTime TimeValue("22:59:00"
, "OtherSub"
Application.OnTime TimeValue("23:59:00"
, "OtherSub"
End Sub
this will call OtherSub every 15 minutes and at the specified times.
The problem I am having is that if I close the workbook and dont close excel then in 15 minutes excel calls the sub and the worbook opens up again automatically.
Also Sometimes instead of opening the workbook I get an error the the memory can't be read at 0x0000002 and excel terminates.
I think all that needs to be done is unload the Application.OnTime from memory, but I dont know how.
Help
Sub MySub()
Call OtherSub
Application.OnTime Now + TimeValue("00:15:00"
End Sub
Sub OncePerHour()
Application.OnTime TimeValue("08:59:00"
Application.OnTime TimeValue("09:59:00"
Application.OnTime TimeValue("10:59:00"
Application.OnTime TimeValue("11:59:00"
Application.OnTime TimeValue("12:59:00"
Application.OnTime TimeValue("13:59:00"
Application.OnTime TimeValue("14:59:00"
Application.OnTime TimeValue("15:59:00"
Application.OnTime TimeValue("16:57:00"
Application.OnTime TimeValue("16:59:00"
Application.OnTime TimeValue("17:59:00"
Application.OnTime TimeValue("18:59:00"
Application.OnTime TimeValue("19:59:00"
Application.OnTime TimeValue("20:59:00"
Application.OnTime TimeValue("21:59:00"
Application.OnTime TimeValue("22:57:00"
Application.OnTime TimeValue("22:59:00"
Application.OnTime TimeValue("23:59:00"
End Sub
this will call OtherSub every 15 minutes and at the specified times.
The problem I am having is that if I close the workbook and dont close excel then in 15 minutes excel calls the sub and the worbook opens up again automatically.
Also Sometimes instead of opening the workbook I get an error the the memory can't be read at 0x0000002 and excel terminates.
I think all that needs to be done is unload the Application.OnTime from memory, but I dont know how.
Help