Problem with opening the workbook of Excel 2007 Format

I have a problem with opening the Excel file of 2007 format. The line which is generating the error is:

>> workbook.open(documentPath); This is working fine with 2003 format but not with 2007 format.

I tried to change the file open method used for 2007 format as follows:

>> workbook.open(documentPath,FileFormatType.EXCEL2007);

And still getting the same exception.

The Exception that I am receiving is:

java.io.IOException: It is not a valid excel2007 file.org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

Any help!

Many Thanks,

Omar


Hi,

Please try our latest version v2.5.0:
http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/entry275246.aspx

If you still find the issue, kindly post your template Excel 2007 file here, we will check your issue soon.

Thank you.

Hi,

From the exception you posted, we think maybe there is some kind of conflict with your dom4j library. Would you please check and make sure there is only one dom4j library in your classpath (commonly, it should be dom4j-1.6.1.jar). Also, please check whether your dom4j library can work fine by parsing a simple xml file without referencing to Aspose.Cells:
e.g
import org.dom4j.Document;
import org.dom4j.io.SAXReader;

SAXReader reader = new SAXReader();
Document doc = reader.read(inputStream); //here inputStream can be a FileInputStream built from one xml file



Thank you.