Error in reading excel

Hi Team,

  1. Currently we are reading excel but due to confidential file it is throwing below error.

Expression evaluation error at function 'readexcelsheetpaging': org.apache.pol.openxml4j.exceptions.OLE2NotOfficexmlFileException. The supplied data appears to be in the OLE2 Format. You are calling the part of POI that deals with OOXML (Office Open XML) Documents. You need to call a different part of POI to process this data (eg HSSF Instead of XSSF)

Can anyone help on this to which function help to check format in excel 

Thanks 

Divya 

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to susmethaasirir

    This is the wrong file format as pointed out by Google Gemini.

    The Root Cause

    Apache POI uses two different "drivers" to handle Excel files based on their format:

    - HSSF (Horrible Spreadsheet Format): For the old OLE2 binary format used in Excel '97–2003 (.xls).

    - XSSF (XML Spreadsheet Format): For the OOXML format used in Excel 2007 and newer (.xlsx).

    The error message OfficeXmlFileException is POI's way of saying: "You gave me a modern XML-based file, but you're using the HSSF classes which only understand the old binary format."

Children
No Data