The supplied data appears to be in the Office 2007+ XML问题解决
时间: 2024-01-03 20:16:25 浏览: 351
The supplied data appears to be in the Office 2007 XML错误描述是由于使用了不匹配的解析类与excel版本导致的异常。根据提供的引用内容,可以使用HSSFWorkbook和XSSFWorkbook来处理不同版本的excel文件。如果文件扩展名是xls,则需要使用HSSFWorkbook来解析,如果文件扩展名是xlsx,则需要使用XSSFWorkbook来解析。根据你提供的代码示例,你可以使用XSSFWorkbook来解析包含Office 2007 XML数据的文件。你可以通过导入org.apache.poi.xssf.usermodel.XSSFWorkbook类来实现这一点。
相关问题
The supplied data appears to be in the Office 2007+ XML.POI only supports OLE2 Office documents
"The supplied data appears to be in the Office 2007 XML"这个错误信息意味着你正在使用POI处理非OLE2 Office文档。POI只支持OLE2 Office文档格式,而不支持Office 2007 XML格式。要处理这种数据,你需要调用POI的其他部分,例如XSSF。因此,你可以尝试使用XSSF来处理该数据,而不是使用HSSF。
The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals
"The supplied data appears to be in the Office 2007 XML. You are calling the part of POI that deals with OLE2 Office Documents." 这个错误是由于使用了错误的POI解析类导致的。POI是一个用于操作Microsoft Office文件的开源库,分为HSSF和XSSF两部分,分别用于处理旧版(xls)和新版(xlsx)的Excel文件。当你使用HSSFWorkbook来解析xlsx文件时,就会出现这个错误。正确的处理方法是使用XSSFWorkbook来解析xlsx文件。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [NPOIDemo.zip](https://download.csdn.net/download/qq_23663693/12370014)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [java处理excel库,poi-bin-4.1.0-20190412](https://download.csdn.net/download/cp62/11156022)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals](https://blog.csdn.net/weixin_46205984/article/details/122255403)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文