In my application, we are upgrading from poi 2.5 version to poi3.7 to
support excel 2007 files. for now I converted HSSF usermodel to XSSF model,
but trying to read .xls file, got the following exception, is it because  I
am not reading .xlsx file?

Does XSSF support only excel 2007 files(.xlsx) and not .xls fiiles?

org.apache.poi.POIXMLException:
org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should
contain a content type part [M1.13]
        at org.apache.poi.util.PackageHelper.open(PackageHelper.java:41)
        at 
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:186)
        at
com.pweh.engtech.readiness.tasks.BaseDocument.retrieveWorkbook(BaseDocument.java:134)

Line number 134 of BaseDocument is in bold below

                XSSFWorkbook book;
                EngtechEnvironment engtechEnvironment = new
EngtechEnvironment();
                templatepath = engtechEnvironment.getBaseDocURL();
                template = ConfigurationManager.getAppProperty(workbookName);
                String filename = templatepath + template;
        logger.debug("*******template file path is********** " + filename);
      //................end
                try {
                    //poi3.7
            book = new XSSFWorkbook(new FileInputStream(filename));
-- 
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Need-help-with-org-apache-poi-POIXMLException-tp3352158p3352158.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to