Bug 46687 - XLSX is corrupted after set value to cell.
Summary: XLSX is corrupted after set value to cell.
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 01:20 UTC by Matthew
Modified: 2009-02-15 12:50 UTC (History)
0 users



Attachments
excel for testing (11.78 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2009-02-10 01:20 UTC, Matthew
Details
excel error log (495 bytes, application/zip)
2009-02-10 01:21 UTC, Matthew
Details

Note You need to log in before you can comment on or make changes to this bug.
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