https://issues.apache.org/bugzilla/show_bug.cgi?id=46535
Summary: Cell type cannot be changed and the output file cannot
be opened by MS Excel 2007
Product: POI
Version: 3.5-dev
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: major
Priority: P2
Component: XSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
I use following codes which assign a string value into a cell.
That cell is a formula cell originally, I found that after the value is
assigned, the cell type is still remain "Formula Type".
AND when I open the output excel file, it cannot be opened by MS Excel 2007.
(In fact, it can be opened but which need to be recovered by MS Excel 2007.)
--
Workbook wb = new XSSFWorkbook("original.xlsm");
String value = "ABC";
Sheet sheet = wb.getSheet("Test");
Row row = sheet.getRow(0);
Cell cell = row.getCell(4);
System.out.println("before cell.getCellType() :" + cell.getCellType());
cell.setCellType(Cell.CELL_TYPE_STRING);
cell.setCellValue(value);
cell.setCellType(Cell.CELL_TYPE_STRING);
System.out.println("after cell.getCellType() :" + cell.getCellType());
FileOutputStream output = new FileOutputStream("output.xlsm");
wb.write(output);
--
Thanks!
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]