0

I've been googling and I've not found one example for this.

I am able to extract the contents for a DOCX file but so far no clue how to get the contents of an EXCEL file.

I know you use

SpreadsheetMLPackage spreadsheetMLPackage = SpreadsheetMLPackage.load(file);

to load the file, but I don't know how to proceed from here. I've check whatever methods SpreadsheetMLPackage has but nothing has gotten me the contents.

iCodeLikeImDrunk
  • 17,085
  • 35
  • 108
  • 169

1 Answers1

1

First you need to understand the structure of a xlsx file.

Unzip one, or run it through the docx4j webapp.

For how the parts relate to one another, see:

http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2007/08/13/1970.aspx

I guess the key method you'll want is getWorksheet

But first you'll need to get the WorkbookPart; do that with spreadsheetMLPackage.getWorkbookPart()

JasonPlutext
  • 15,352
  • 4
  • 44
  • 84