data.xls <http://apache-poi.1045710.n5.nabble.com/file/n5716738/data.xls>  


Hello,
I am creating a password protected file of format Excel 97-2003 Workbook
(.xls) using Microsoft Office 2013.
I have written a java program to read password protected excel file using
POI API. I am able to read .xlsx file using this API, but I am not able to
read .xls file. It throws error :
org.apache.poi.hssf.record.RecordFormatException: Unknown encryption info 4
        at 
org.apache.poi.hssf.record.FilePassRecord.<init>(FilePassRecord.java:70)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at
org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:87)
        at
org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:338)
        at
org.apache.poi.hssf.record.RecordFactoryInputStream$StreamEncryptionInfo.<init>(RecordFactoryInputStream.java:73)
        at
org.apache.poi.hssf.record.RecordFactoryInputStream.<init>(RecordFactoryInputStream.java:182)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:477)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:301)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:264)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:199)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:342)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:323)

Using same java code I am able to read .xls file if I use Microsoft Office
2010 to create this password protected file. 
My OS is Windows 8(64-bit).
I am using latest Apache POI API i.e. “poi-3.10.1-20140818.jar”. 
Can you please let me know how I can solve this issue. I have attached XLS
file for reference.
Thanks
Vishal





--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Bug-35897-Password-protected-files-tp5715183p5716738.html
Sent from the POI - Dev mailing list archive at Nabble.com.

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

Reply via email to