Created attachment 23226 [details] Repro file for the issue Read an xlsx file and call shiftRows. Write the resultant workbook to a file and open in MS office 2007. Office throws the following error "Excel found unreadable content." and asks for recovering. Following recovery message is thrown: Removed Records: Cell information from /xl/worksheets/sheet1.xml part The row gets shifted but it shifts the first column and last column is lost.
Created attachment 23227 [details] xlsx file used for testing
fixed by modifying the following code is in XSSFCell.java protected void modifyCellReference(XSSFRow row) { this.cell.setR(new CellReference(row.getRowNum(), cellNum).formatAsString()); CTCell[] ctCells = row.getCTRow().getCArray(); for (CTCell ctCell : ctCells) { ctCell.setR(new CellReference(row.getRowNum(), cellNum).formatAsString()); } } with this: protected void modifyCellReference(XSSFRow row) { int cnum = 0; this.cell.setR(new CellReference(row.getRowNum(), cnum).formatAsString()); CTCell[] ctCells = row.getCTRow().getCArray(); for (CTCell ctCell : ctCells) { ctCell.setR(new CellReference(row.getRowNum(), cnum++).formatAsString()); } }
This is fixed in the latest trunk