Java – XSSFWorkbook constructor is undefined

apache-poijavaxssf

I'm trying to make an XSSFWorkbook like this

File file = new File(fileName);
Workbook workbook = new XSSFWorkbook(file);

But I get the error:

The constructor XSSFWorkbook(File) is undefined

I checked here: http://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFWorkbook.html and it says that there is a constructor that takes files

XSSFWorkbook(java.io.File file)
Constructs a XSSFWorkbook object from a given file.

Why isn't it working?

Best Answer

Use...

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.10.1</version>
</dependency>
Related Topic