Page 1 of 1

Import xls

PostPosted: Thu Mar 17, 2016 9:16 pm
by A.L
Hello everyone,

I have tried to import several .xls files with the SpreadsheetMLPackage.load(File file) methods. So far, I don't have any problems with .xlsx files and some .xls but for the majority of the .xls files, I have the same error :

Code: Select all
private SpreadsheetMLPackage openXlsxXslx4J() throws FileNotFoundException, Docx4JException {
    SpreadsheetMLPackage pkg = null;
    if(pathFile!=null && !pathFile.isEmpty()){
        File file = new File(pathFile);
        if(file!=null){
            pkg = SpreadsheetMLPackage.load(file);
        }
    }
    return pkg;
}

org.docx4j.openpackaging.exceptions.Docx4JException: Problem reading compound file
cause = java.io.FileNotFoundException: no such entry: "EncryptionInfo"


For what I have seen, the EncryptionInfo is used for password protected files but mine are not :/

I attached two .xls, I import the first one without problemes but not the second.

Appreciate your help on this.
A.L

Re: Import xls

PostPosted: Tue Apr 19, 2016 7:09 pm
by A.L
Hello everyone,

So I didn't realize .xls are not archive files with wml behind (or at least tere are differents than .doc, .docx, .xlsx, etc.). And since its different, it returns somehow the condition to parse a .xlsx encrypted.
So for now a I just force to convert a .xls to a .xlsx

Hope it helps :)

A.L