Bug 46687

Summary: XLSX is corrupted after set value to cell.
Product: POI Reporter: Matthew <matthew.knl>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: excel for testing
excel error log

Description Matthew 2009-02-10 01:20:11 UTC
Created attachment 23244 [details]
excel for testing

I use following code try to set a cell value, but after it cannot be opened by MS Word. (It prompted an error message and asked for recover)

--
Workbook wb = new XSSFWorkbook("original.xlsx");
Sheet sheet = wb.getSheet("HouseShippingOrder");
Cell cell = sheet.getRow(1).getCell(10);
cell.setCellFormula(null);
cell.setCellValue("ABC");
wb.write(new FileOutputStream("output.xlsx"));
Comment 1 Matthew 2009-02-10 01:21:32 UTC
Created attachment 23245 [details]
excel error log
Comment 2 Matthew 2009-02-11 22:11:46 UTC
Sorry for typo mistake. The bug description should be:

I use following code try to set a cell value, but after it cannot be opened by
MS EXCEL. (It prompted an error message and asked for recover)
Comment 3 Yegor Kozlov 2009-02-15 12:50:23 UTC
Fixed in r744750.
There was another issue with formula calculation chain - if it becomes empty, the chain object must be removed because the SpreadsheetML schema requires it to be non-empty. 

Yegor