title: stopping an excel VBA macro from closing
body: <p>I've written some very basic VBA code to do a simple task: remind me to fill in my timesheet (which is an Excel s/sheet). it's worked for me for many years while I went to the office, turned on the computer and had Excel in my 'startup' folder. However, now my life has changed a bit and I use my laptop and don't tend to shut it down and therefore the macro doesn't get fired up.</p>
  
  <p>Here's how it opens:</p>
  
  <pre><code>Private Sub Workbook_Open()
      Application.OnTime TimeValue("17:00:00"), "box"
      If TimeValue("17:00:00") &lt; Time Then
         Run ("box")
      End If
      ActiveWindow.WindowState = xlMinimized
      Run ("morning")
  End Sub
  </code></pre>
  
  <p>here's 'box':</p>
  
  <pre><code>Sub box()
  
      response = MsgBox("Have you filled in your timesheet?", vbYesNo, "timesheet")
  
      If response = vbYes Then
          ActiveWindow.WindowState = xlMinimized
      End If
      If response = vbNo Then
          Workbooks("timesheet2015 - GZ.xlsm").Activate
          ActiveWindow.WindowState = xlMaximized
      End If
  End Sub
  </code></pre>
  
  <p>And here's 'morning'</p>
  
  <pre><code>Sub morning()
      response = MsgBox("Did you fill in your timesheet yesterday?", vbYesNo, "timesheet")
  
      If response = vbYes Then End
      If response = vbNo Then
          Workbooks("timesheet2015 - GZ.xlsm").Activate
          ActiveWindow.WindowState = xlMaximized
      End If
  End Sub
  </code></pre>
  
  <p>I've been scratching my head working out if there's a way to stop the macro from ending once it's run once. I don't want to have some huge endless loop or it will slow the laptop down. I'm sure there's a simple way to do it so would love your help.</p>
  
  <p>thanks!</p>