Nov 1, 2018

How to fix: 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)

If you encounter: 

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)

This is because of wrong file type. You can ask POI to auto-detect which file type you have, and pick the appropriate one of HSSF or XSSF for you. The best practice is to use interfaces rather than concrete classes, so your code works whether you get a HSSF or XSSF object.

Workbook wb = WorkbookFactory.create(new File("/path/to/your/excel/file")); 
Sheet mySheet = wb.getSheetAt(0);
Iterator<Row> rowIter = mySheet.rowIterator(); 
System.out.println(mySheet.getRow(1).getCell(0));
//This will then work for both .xls and .xlsx files

See more:
The POI website has a guide to making these changes which should guide you through.