Apache POI from version 3.6 onwards has support for SpreadSheetML (Microsoft’s Open Office XML standard). With SpreadSheetML you can generate Excel files as XML. The XML file needs to be compliant with the OOXML schema. The file extension for “.xlsx”.
To create a Excel document using OOXML use the command:
Workbook wb = new XSSFWorkbook();
To create in binary (OLE) format, use the below constructor for creating the workbook:
Workbook wb = new HSSFWorkbook();
That’s all! All further processing is the same for both XSSF and HSSF workbook formats.
Hi,
i want to write a java code which can read the xls file as well as xlsx file irrespective of the file type
i can read xls,xlsx files individually,if i written a code for reading xlsx can it support xls file
Thanking you,
You can use the latest version of the Apache POI. It has support for both the formats.