I receive the following error when calling Cell.getCellType on cells formatted as date. The input is an .xlsx file. org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: string value 'd' is not a valid enumeration value for ST_CellType in namespace http://schemas.openxmlformats.org/spreadsheetml/2006/main at org.apache.xmlbeans.impl.values.JavaStringEnumerationHolderEx.set_text(JavaStringEnumerationHolderEx.java:40) at org.apache.xmlbeans.impl.values.XmlObjectBase.update_from_wscanon_text(XmlObjectBase.java:1180) at org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlObjectBase.java:1319) at org.apache.xmlbeans.impl.values.JavaStringEnumerationHolderEx.getEnumValue(JavaStringEnumerationHolderEx.java:60) at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellImpl.getT(Unknown Source) at org.apache.poi.xssf.usermodel.XSSFCell.getBaseCellType(XSSFCell.java:719) at org.apache.poi.xssf.usermodel.XSSFCell.getCellType(XSSFCell.java:681) at org.apache.poi.xssf.usermodel.XSSFCell.getDateCellValue(XSSFCell.java:755) I updated to the latest 4.1 version but the error persists.
Can you attach a spreadsheet that demonstrates the issue?
ST_CellType="d" was added to the OOXML standard in ECMA-376:2012. POI doesn't support strict mode yet, or the later extensions. POI OOXML currently is based on the 2006 schemas, which did not include "d" (ISO date) as a value type.
Created attachment 36520 [details] Testdata
Is there a workaround?
The POI streaming support does not use the generated classes based on the OOXML schemas - the plus is that it can parse your file but the minus is that the feature support is a lot less. https://github.com/pjfanning/excel-streaming-reader-sample -- I used this code to parse your file