title: VBA - Close window
body: <p>I have a macro that creates 17 workbooks in a loop. When it's done working on a workbook it closes it and goes to the next with:</p>
  
  <pre><code>ActiveWorkbook.Save
  ActiveWindow.Close
  </code></pre>
  
  <p>This has always worked fine until recently. Suddenly on loop nr. 7 it say (the 6 loops before still working fine):</p>
  
  <blockquote>
    <p>Run-time '-2147417848 (80010108)':</p>
    
    <p>Method 'Close' of objekt 'Window' failed</p>
  </blockquote>
  
  <p>I can delete "ActiveWindow.Close" and close all the workbooks manually to make the macro work. But still...</p>
  
  <p>Any knows why it does this?</p>