Search code examples
apache-poipoi-hssf

How can we read protected password excel file (.xls) with POI API


I've just learned POI and find the HSSF is very simple to read and create excel file (.xls). However, I found some problem when want to read excel protected with password. It took me an hour to find this solution on internet.

Please could you help me to solve this problem. I'm very glad if you could give me a code snippet.

Thank you.


Solution

  • POI will not be able to read encrypted workbooks - that means that if you have protected the entire workbook (and not just a sheet), then it won't be able to read it. Otherwise, it should work.