Bug 62937

Summary: Can't Load Workbook on Windows
Product: POI Reporter: TobyPeepsMagoo <skyler>
Component: POI OverallAssignee: POI Developers List <dev>
Severity: major    
Priority: P2    
Version: 4.0.0-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description TobyPeepsMagoo 2018-11-21 19:59:00 UTC
I'm trying to deliver a jar using POI 4.0 to a coworker who's running on Windows 10.  I can load an excel file without any errors.  However, on Windows 10, I get the following error:

java.io.IOException: java.lang.NoSuchMethodException: org.apache.poi.xssf.usermodel.XSSFWorkbookFactory.createWorkbook(sun.awt.shell.Win32ShellFolder2, boolean)

The error occurs when I use the following line:
workbook = WorkbookFactory.create(file,null,true);

Any ideas on how to get the workbook to load in Windows 10?
Comment 1 TobyPeepsMagoo 2018-11-21 21:28:22 UTC
Fixed the issue by instantiating an XSSFWorkbook instead of using the WorkbookFactory
Comment 2 Andreas Beeker 2018-11-21 21:52:56 UTC
Actually your imports are wrong ... instead of "sun.awt.shell.Win32ShellFolder2" you would have needed to import "java.io.File".