1

I am facing an Issue while reading Excel sheet (xls/xlsx) created from Microsoft Office 2013.

<cfspreadsheet 
    action="read" 
    src="E:\FromD\Test Codes\POIUtility\examples\sheet.xls" 
    name="SpreadsheetObj"> 
</cfspreadsheet>

Here are the errors:

An error occurred while reading the Excel: org.apache.poi.EncryptedDocumentException: The supplied spreadsheet seems to be an Encrypted .xlsx file. It must be decrypted before use by XSSF, it cannot be used by HSSF.

An error occurred while reading the Excel: org.apache.poi.hssf.record.RecordFormatException: Unknown encryption info 4.

I tried with CF9 and CF10. Found same error on both versions. Also, I updated POI jar files with updated POI 3.10 but no luck. Followed these links :

Any help will be appreciated.

Leigh
  • 28,765
  • 10
  • 55
  • 103
Sks
  • 612
  • 7
  • 23
  • Can you share some code? – Anit Kumar Aug 07 '14 at 18:04
  • 2
    From what I can see CF10 and CF9 don't support Office 2013. https://wikidocs.adobe.com/wiki/display/coldfusionen/Supported+Office+conversion+formats . This blog specifies support for Office 2010 though. http://coldfusionblog.wordpress.com/2012/05/23/what-is-new-in-coldfusion-10/ – Alan Bullpitt Aug 07 '14 at 18:06
  • Anit, Its simple . Issue is with Excel sheet, tomorrow I will attach sample spreadsheets here. – Sks Aug 07 '14 at 18:09
  • I'm able to do it. Using version 9 something, this code ran successfully. – Dan Bracuk Aug 07 '14 at 18:28
  • It might be relevent that my co-worker wrote the excel file and emailed it as an attachment. I put it into position with Outlook 2010 using file save as. – Dan Bracuk Aug 07 '14 at 18:38
  • 3
    So are your files encrypted or protected in some way? – Leigh Aug 07 '14 at 19:10
  • Here is the excel file: https://www.dropbox.com/s/0879kn0da6aoqou/CFSI_CMRT3-01%20(2).xls – Sks Aug 08 '14 at 08:29
  • Apache POI [supports reading Encrypted Excel files](http://poi.apache.org/encryption.html), but you need to go down a different code path to supply the decryption password before they can be read. No idea if ColdFusion supports doing that, you might need to call out to Java directly instead – Gagravarr Aug 08 '14 at 10:25
  • Yes, probably I need to decrypt it using Java. – Sks Aug 08 '14 at 12:01
  • @Leigh not sure about. Spreadsheet not created by me. – Sks Aug 08 '14 at 13:00
  • Ask the person that produced it. Also, what happens when you try other Excel 2013 files? – Leigh Aug 11 '14 at 14:46
  • No issues while uploading sheets other then Excel 2013 sheets. He is also not sure about. I guess issue is with Protected mode of excel 2013. – Sks Aug 14 '14 at 05:35
  • I did not quite follow that. What happened when you tried processing *other* Excel 2013 files? Ones you know are NOT protected. – Leigh Aug 14 '14 at 14:48
  • Other works well, but if I process some protected files then I get this type of error: http://awesomescreenshot.com/01f3cav2f7 not getting any workaround :( – Sks Aug 20 '14 at 05:43
  • Getting some more errors like -The supplied POIFSFileSystem does not contain a BIFF8 'Workbook' -Duplicate PageSettingsBlock record (sid=0x89c) - coldfusion.excel.ExcelProcessException: An exception occurred while using action=read. at coldfusion.excel.Excel.readXLS – Sks Aug 21 '14 at 13:46
  • You still did not answer my question. Did you confirm that it is a problem with ALL Excel 2013 files OR is it a problem ONLY with Excel 2013 files that are protected? – Leigh Aug 26 '14 at 17:40
  • No problem is not with all excel 2013 files. Problem is with XLSX files. – Sks Aug 26 '14 at 17:41
  • Landed here after googling this error: **Unknown encryption info 4** and I am having that same error on Java. I have also explored the bug fixes released and it does not work. Strange enough, my files are also CFSI_CMRT templates. – vikkee Jan 07 '17 at 01:08

0 Answers0