[Java] [Apache POI] Corresponding Excel version

1 minute read

Contents of this article

When using Apache POI to read and write Excel in Java, the types of components supported differ depending on the version of Excel, and there were versions that could not be used, so I decided to summarize it as a memorandum.
(If you make a mistake, please let me know.)

What is Apache POI?

First, let’s take a brief look at Apache POI.
Apache POI is a library that allows Java programs to read and write Office files.
> Apache POI official website

Components used to read and write Excel

There are three types of components for reading and writing Excel, and the one used depends on the extension and usage.

component Read write extension Corresponding version
HSSF .xls Excel 97-Excel 2003 (BIFF 8)
XSSF .xlsx Excel 2003- (OOXML)
SXSSF × .xlsx Excel 2003- (OOXML)

HSSF and XSSF are used during normal reading and writing according to the version of Excel.

  • Please note that it cannot be used with versions earlier than Excel 97 (BIFF 5.0, 7.0).
    SXSSF cannot read, but it optimizes memory when writing Excel with a large file size.
    (Although it is not official Apache POI, a library called Streaming Reader is useful when loading.)

    in conclusion

    This time I briefly summarized the versions and components of Excel that can use Apache POI, but I hope to summarize how to use Apache POI at a later date.