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:
ActiveWorkbook.Save
ActiveWindow.Close
This has always worked fine until recently. Suddenly on loop nr. 7 it say (the 6 loops before still working fine):
Run-time '-2147417848 (80010108)':
Method 'Close' of objekt 'Window' failed
I can delete "ActiveWindow.Close" and close all the workbooks manually to make the macro work. But still...
Any knows why it does this?