碰到了一个因为导入一个Excel文件的问题
The supplied data appears to be in the Office 2007+ XML
错误描述
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
解决问题
进行判断类型中的区别
也罗列出来了,一个是导入xls的一个是xlsx的
然后最后想说的是,如果是xls的话使用HSSFWorkbook,如果是xlsx的话使用XSSFWorkbook,就不会产生类似报错信息了