It seems there is a bug related to Pivot tables. When you delete sheet with the pivot table, the workbook XML document is not affected the right way => pivotCaches node still contains pivotCache of the deleted pivot table.
When you then try to open such an Excel file Repair window appears.
When you then try to open such an Excel file Repair window appears.