File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Problem in creating Workbook with .xlsx file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Problem in creating Workbook with .xlsx file" Watch "Problem in creating Workbook with .xlsx file" New topic

Problem in creating Workbook with .xlsx file

mamata surapaneni

Joined: Jul 24, 2007
Posts: 10
I am using the code

file = new File(fileName);
workbook = Workbook.getWorkbook(file);
Sheet sheet = workbook.getSheet(0);

The code is working fine for .xls (Excel 2003) and not working for .xlsx ( Excel2007). Is that anythin extra need for .xlsx files.Please help me.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

The HSSF website clearly states that the library "does not support the new Excel 2007 .xlsx OOXML file format, which is not OLE2 based." Meaning you shouldn't expect it to work.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Problem in creating Workbook with .xlsx file
It's not a secret anymore!