I use following codes to shift rows, the result output file cannot be opened by MS Excel 2007. (In fact, it can be opened but which need to be recovered by MS Excel 2007.) And the result content is not as expected. -- Workbook wb = new XSSFWorkbook("original2.xlsm"); Sheet sheet = wb.getSheet("Test"); sheet.shiftRows(1, sheet.getLastRowNum(), 3, false, true); FileOutputStream output = new FileOutputStream("output2.xlsm"); wb.write(output); -- Thanks!
Created attachment 23124 [details] the source excel file.
Created attachment 23125 [details] the output excel file.
Created attachment 23126 [details] error prompt by ms excel 2007
Created attachment 23127 [details] error fixed by ms excel 2007
I have to delay my company project because it rely heavily on this function. I raise the severity to critical and hope POI developers can get this bug resolved. Many thanks!
Hi - Same comment as for bug 46535. I am not saying that this is a duplicate, just that I'd like you to try xlsx and provide the repair log. Regards, Dave
Thanks for your reply! Now I use a xlsx file for testing, it produces the same error, please check the attachment file.
Created attachment 23233 [details] xlsx file for test
Created attachment 23234 [details] excel error log
Created attachment 23235 [details] the xlsx file for test
Fixed in r742126 There were several reasons why the resulting file was corrupted. When shifting cells with formulas, we need to check the following: 1. Update formulas on the sheet to point to the new location. 2. Remove references to the shifted cells from the calculation chain Yegor