title: VBA On Error not catching errors
body: <p>Posting this here, in case it can help others. I was seeing some strange behavior where:</p>
  
  <pre><code>Sub somesub()
  On Error GoTo Handler
      Dim x
      x = 1/0
      MsgBox("Done")
      Exit Sub
  Handler:
      MsgBox("Error was handled")
  End Sub
  </code></pre>
  
  <p>Was not catching the error. </p>
  
  <p>There is a related question on SO already, at: <a href="https://stackoverflow.com/questions/28413919/excel-vba-not-properly-breaking-on-error">Excel VBA Not Properly Breaking on Error</a>, but it is asking about how to mitigate side effects of making one choice or another in the Error Trapping settings. This is asking why the error handling is not working <em>at all</em>.</p>