Bug 62937 - Can't Load Workbook on Windows
Summary: Can't Load Workbook on Windows
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 4.0.0-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-21 19:59 UTC by TobyPeepsMagoo
Modified: 2018-11-21 21:52 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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".