Created attachment 24243 [details] Test case to demonstrate problems with XSSFWorkbook.removeSheetAt. Application modifies a template worksheet to which a separate chart refers. It then attempts to delete a control sheet containing parameters for the run. In my app, it deletes the chart instead, leaving the control sheet in the output workbook. I've attached a test case which demonstrates the above, as well as throwing a XmlValueDisconnectedException when there are two "control" sheets to delete. It works properly if the chart is the last item in the workbook.
The problematic workbooks were created by Excel 2008 for Mac, version 12.2.1.
Fixed in r814176 Sheets of type 'chartsheet' were not supported and XSSFWorkbook.removeSheetAt actually modified wrong data. Yegor