Quantcast

Could POI open Password Protected Excel Sheet....

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Could POI open Password Protected Excel Sheet....

guruk
Hi,

Could anyone tell me if poi can open password protected excel file to convert it to csv, i have the password for the excel file but dont know how to use it in POI....

Thanks in advance..
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Could POI open Password Protected Excel Sheet....

Mark Beardsley
Can you tell us please which version of the Excel file format you are targetting; the older binary file format (.xls) or the newer OOXML one (.xlsx)?

Yours

Mark B

guruk wrote
Hi,

Could anyone tell me if poi can open password protected excel file to convert it to csv, i have the password for the excel file but dont know how to use it in POI....

Thanks in advance..
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Could POI open Password Protected Excel Sheet....

guruk
We are trying to handle the .xls(97-2003) Excel file format ....

thanks for your time

Guru

MSB wrote
Can you tell us please which version of the Excel file format you are targetting; the older binary file format (.xls) or the newer OOXML one (.xlsx)?

Yours

Mark B

guruk wrote
Hi,

Could anyone tell me if poi can open password protected excel file to convert it to csv, i have the password for the excel file but dont know how to use it in POI....

Thanks in advance..
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Could POI open Password Protected Excel Sheet....

Mark Beardsley
As far as I know (and I could well be wrong as there are many people using the API and modifying it to suit their needs, so it is always wise to wait to see if another list member replies), POI can process password protected workbooks as long as they are not encrypted. If it were me, I would write just a very simple piece of code to try to open the workbok, get a sheet from it and print out the contents of a few cells. At least that would tell you whether the API is able to parse this particular workbook. This would also give you the chance to play with a class that Josh created - I do not know if he meant it to be used in this way but it would be well worth a go I think - p://poi.apache.org/apidocs/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.html. Personally, I have not knowingly seen this used and would be interested to find out what happens.

If that fails, then you have a few options open to you. As far as I know - although I have never used this tool - there is a commercial product marketed by a company called Aspose; quite expensive but they may offer a limited trial product. Further, if you are running under windows, you can use OLE/COM automation and a third party library such as JACOB or the OLE32 package from the Standard Widget Toolkit to actually control an instance of Excel from Java code and that will certainly be able to process the workbook. OpenOffice may be a third option but I do not know if it is able to work with encrypted workbooks any better than is POI.

Yours

Mark B

guruk wrote
We are trying to handle the .xls(97-2003) Excel file format ....

thanks for your time

Guru

MSB wrote
Can you tell us please which version of the Excel file format you are targetting; the older binary file format (.xls) or the newer OOXML one (.xlsx)?

Yours

Mark B

guruk wrote
Hi,

Could anyone tell me if poi can open password protected excel file to convert it to csv, i have the password for the excel file but dont know how to use it in POI....

Thanks in advance..
Loading...