This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
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: 32319

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]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
wood burning stoves
subject: Problem in creating Workbook with .xlsx file
It's not a secret anymore!