poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MSB <markbrd...@tiscali.co.uk>
Subject Re: writeProtectWorkbook() method does not work to set password to excel file to open
Date Tue, 22 Sep 2009 06:10:42 GMT

On the 16th of September, I posted two replies to your original question.
Neither I am sorry to say contained any good news but I have copied the text
out of the second reply for you below;

"Sorry to say that I cannot report any real progress and that I am moving
toward the conclusion that it is not possible to set the open password for
an Excel file using POI.

As I indicated in an earlier post, I did try using a template file that I
created with Excel and which had an open password. Unfortunately, it was
not possible even to open this file using POI, closing that avenue of
exploration quite conclusively.

The writeProtectWorkbook() method does work after a fashion; if you try
to open the file using Excel, you will be asked for a password but it is
still possible to view a read-only copy of it's contents even if you do
not supply a password.

Not too sure what your options are at this stage though I am confident many
people would appreciate it if you would consdier patching the API to support
setting the open password. Other than that, I would guess that you could
look at;

* Creating an on activation macro that would prompt the user to enter
  a password.
* Using OpenOffices' UNO interface to automate the base application and use
  that to create Excel workbooks.
* Using OLE to control Excel itself directly from Java code.

None of these solutions is ideal in my opinion as each has it's own inherent
limitations but they could offer you a short term fix.

Yours

Mark B"



Debendra wrote:
> 
> Hi Mark,
> Could you please inform us, did you get any solution for this.
> 
> Regards,
> Debendra
> 
> 
> Debendra wrote:
>> 
>> Hi All,
>> You are saying that it is not possible to set password to an excel file
>> to open using existing POI API. If it is not possible to create a
>> password protected excel sheet which asks password to open then we need
>> to put our effort to add this functionality to POI. If you have found out
>> a way to do this using POI then could you please publish the same in this
>> discussion.
>> 
>> Regards,
>> Debendra
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/writeProtectWorkbook%28%29-method-does-not-work-to-set-password-to-excel-file-to-open-tp25447832p25530583.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Mime
View raw message