poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hehabr <heh...@web.de>
Subject Apache POI : Problem with Excel updating
Date Sun, 09 Jul 2017 15:32:47 GMT
Apache POI : Problem with Excel updating, 
after the new values are written to the cells : 
java.lang.IllegalStateException: Cannot get a NUMERIC value from a STRING
cell

What could be the problem? How to fix it?


I work with 5 files, 3 of them work as they should, and 2 others do not.
Workaround for 2 bad files:
Runtime.getRuntime().exec("cmd /c start " + excel.getAbsolutePath());



//
---------------------------------------------------------------------------

// Here: new values are written into the cells

workbook.getCreationHelper().createFormulaEvaluator().evaluateAll();
workbook.setForceFormulaRecalculation(true);

OutputStream output = new FileOutputStream(excel.getAbsolutePath());
workbook.write(output);
output.flush();
output.close();

// Here, new values are subtracted from the cells, 
after Excel resolves with new values 


//
---------------------------------------------------------------------------

// Value in bad Cell: =B24

java.lang.IllegalStateException: Cannot get a NUMERIC value from a STRING
cell
	at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:1050)
	at
org.apache.poi.xssf.usermodel.XSSFCell.getNumericCellValue(XSSFCell.java:310)
	at quicc.excel.api.ExcelHandlerXSSF.handleCell(ExcelHandlerXSSF.java:275)
	at quicc.excel.api.ExcelHandlerXSSF.readCell(ExcelHandlerXSSF.java:251)
	




--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Apache-POI-Problem-with-Excel-updating-tp5728112.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message