Apache POI 4.x here. I see there are two types of Workbook
implementations:
- HSSF Workbook
- XSSF Workbook
I need to write a Java 8 app that reads Excel sheets with either ".xls
" (XLS) or ".xlsx
" (XLSX) extensions. Meaning, Excel files that were saved in the "old" (pre 2003) format, or the newer one.
Is it safe to assume I use HSSF for XLS files, and XSSF for XLSX files? Or is the mapping logic a little bit more complicated there? This answer seems to indicate I'm correct, but that doesn't leave me feeling totally sure that I understand the mapping and "when to use" logic of HSSF vs XSSF.
I've scoured the POI documentation but can't find a clear answer for the life of me.
WorkbookFactory
+org.apache.poi.ss.usermodel
and let Apache POI figure out the type for you?