As the error message suggests, you can't use HSSFDocument to read an XLSX
file.
See https://poi.apache.org/encryption.html

Are you sure you were able to read the same XLSX (not XLS) document with
3.9?


Based on our download numbers, a lot of users are still on 3.9. Out of
curiosity, I have been trying to figure out why that's a popular version,
whether it's because it's lexicographically higher than 3.10 and so wasn't
showing up on people's update list, if there are major libraries that bring
in an old version of poi as a dependency, or if there were backwards
compatibility problems that kept people from upgrading to 3.10.

On Feb 27, 2017 3:49 AM, "Sateesh K Kolusu" <sateesh.kol...@in.ibm.com>
wrote:

The attachment(s) test1.xlsx could not be scanned for viruses because it is
a password protected file.
------------------------------
Hello Javen - Thank you for the prompt reply

The file in question is



The password is "qa"

At the time of moving to higher version of POI we had 3.14 in mind and so
we moved.

The stack trace is
*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 *

---
Thanks
Sateesh K Kolusu
Software Engineer - Connectivity
IBM Analytics



From:        "Javen O'Neal" <one...@apache.org>
To:        POI Users List <user@poi.apache.org>
Date:        02/27/2017 05:10 PM
Subject:        Re: Password protected workbook working with POI 3.9 but
not working POI 3.14
------------------------------



If you included an attachment, it didn't make it through.

Are you getting a compile time or run time error? What is the error message
and stack trace?

You're welcome to read through the changelog at
https://poi.apache.org/changes.htmlto see what changes occurred. If you

don't find anything that explains your problem, you can search through
bugzilla or look for changes to the source if you can narrow it down to a
few files.

Did you try any other builds?

We have made quite a few improvements to password protection in the last
few versions, and it's possible that one or more of those changes broke
backwards compatibility. We aim for maintaining deprecated APIs for at
least 2 releases prior to removing or changing them, so you may want to
compile with 3.11 with deprecated usage ignored, then compile with 3.11
with deprecated usage as fatal, then compile with 3.13 and repeat, then
3.15 and repeat.

FYI, 3.15 is the latest final version. Any reason for testing with 3.14?

On Feb 27, 2017 3:20 AM, "Sateesh K Kolusu" <sateesh.kol...@in.ibm.com>
wrote:

Hello all -  I have a Excel workbook with password protected. The
following code worked with APACHE POI 3.9 but not 3.14

if (POIFSFileSystem.hasPOIFSHeader(fileIn) == true)
        {
           try
           {
              workbook = new HSSFWorkbook(fileIn, bDocProps);
           }
           catch (EncryptedDocumentException encryptedEx)
           {
              encryptionException = true;
              // Supplied password is invalid for Excel 2003 file
              message = CC_UnstructuredResourceBundle.getString(
                    "CC_UNSTRUCTURED_MSG_EXCEL_INVALID_PASSWORD");

           }

Any inputs if there are changes in 3.14 will be appreciated.

---
Thanks
Sateesh





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org

Reply via email to