title: Excel VBA ThisWorkbook Close Stopped Working
body: <p>I am curious as to the possible reasons why ThisWorkbook.Close has stopped working when a button on a userform is clicked. Now I receive a 1004 error </p>
  
  <blockquote>
    <p>Method Close or object Workbook failed</p>
  </blockquote>
  
  <p>Previous backups of the workbook are fine and close down without error. Events have not been disabled. ThisWorkbook.Save or Application.Quit work ok.</p>
  
  <p>Could getting trapped and have to resort to using Ctrl-Alt-Del to kill Excel to close the workbook do anything?</p>
  
  <p>Any ideas?</p>
  
  <pre><code>Private Sub cmbClose_Click()
  
  On Error GoTo errHandler:
  
  '   Close workbook
  ThisWorkbook.Close
  
  '   Error handler
  On Error GoTo 0
  Exit Sub
  
  errHandler::
      MsgBox "An Error has Occured " &amp; vbCrLf &amp; "The error number is : " _
      &amp; Err.Number &amp; vbCrLf &amp; Err.Description &amp; vbCrLf &amp; vbCrLf &amp; _
      "Please take a screenshot of this message and contact the developer "
  
  End Sub
  </code></pre>