title: Close a Workbook if opened
body: <p>I would like an error handler to handle closing an Excel workbook that is not open.</p>
  
  <p>I tried below code.</p>
  
  <pre><code>If Workbooks("Combo.xlsx").IsOpen Then 
       Workbooks("Combo.xlsx").Close SaveChanges:=False 
  Else: Resume Next 
  MsgBox "Error: (" &amp; Err.Number &amp; ") " &amp; Err.Description, vbCritical 
  End If 
  </code></pre>
  
  <p>This gives me an error message:</p>
  
  <blockquote>
    <p>Run time Error: 9 Subscript Out of Range.</p>
  </blockquote>