https://issues.apache.org/bugzilla/show_bug.cgi?id=57181
Bug ID: 57181
Summary: Apache POI 3.9 API to unable to read 2007 xlsm file
Product: POI
Version: unspecified
Hardware: PC
Status: NEW
Severity: blocker
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Hi
Below is the code base to read xlsm file :
Sheet sheet = null;
try
{
byte[] filedata = attachmentValue.getFileData();
InputStream inputFileStream = new ByteArrayInputStream(filedata);
//Create Workbook instance for xlsm file input stream
Workbook workbook = null;
if(attachmentValue.getFileName().toLowerCase().endsWith("xlsm") ){
workbook = new XSSFWorkbook(inputFileStream);
}
sheet = workbook.getSheetAt(0);
}
catch (Exception e) {
}
The above highlighted code is working fine with the xlsm file created with
Microsoft Office 2010 but throwing below exception with Microsoft office 2007 :
[11/3/14 23:09:26:424 SGT] 0000019e SystemErr R
org.apache.poi.POIXMLException:
org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should
contain a content type part [M1.13]
[11/3/14 23:09:26:425 SGT] 0000019e SystemErr R at
org.apache.poi.util.PackageHelper.open(PackageHelper.java:41)
[11/3/14 23:09:26:426 SGT] 0000019e SystemErr R at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:204)
Please suggest if anyone has identified & fixed same kind of issues.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]