title: How can I check for or cancel MULTIPLE pending application.ontime events in excel VBA?
body: <p>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_BeforeSave event.  As such, if a user <strong>(changes the desired time + saves the workbook)</strong> multiple times, multiple Application.Ontime events are created.  Theoretically I could keep track of each event with a unique time variable.. but is there a way to check/parse/cancel pending events?</p>
  
  <pre><code>Private Sub Workbook_BeforeSave
      SendTime = Sheets("Email").Range("B9")
      Application.OnTime SendTime, "SendEmail"
  End Sub
  
  Private Sub Workbook_BeforeClose
      Application.OnTime SendTime, "SendEmail", , False
  End Sub
  </code></pre>
  
  <p>So if I:<br>
  change B9 to 12:01, Save the workbook<br>
  change B9 to 12:03, Save the workbook<br>
  change B9 to 12:05, Save the workbook<br>
  change B9 to 12:07, Save the workbook<br>
  etc</p>
  
  <p>I end up with multiple events firing.  I only want ONE event to fire (the most recently scheduled one)</p>
  
  <p>How can I cancel ALL pending events (or enumerate them at least) on the Workbook_BeforeClose event?</p>