How can I check for or cancel MULTIPLE pending application.ontime events in excel VBA?

后端 未结 4 360
遇见更好的自我
遇见更好的自我 2021-01-17 23:22

I\'m using the Application.Ontime event to pull a time field from a cell, and schedule a subroutine to run at that time. My Application.Ontime event runs on the Workbook_Be

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-18 00:01

    Each time you call Application.Ontime save the time the event is set to run (you could save it on a sheet or in a module scoped dynamic array)

    Each time your event fires, remove the corresponding saved time

    To cancel all pending event iterate through the remaining saved times calling Application.Ontime with schedule = false

提交回复
热议问题