You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Daggubati <ma...@gmail.com> on 2009/07/08 22:53:28 UTC
Setting Range Protection in Excel File using Jakarta POI
I am using Jakarta HSSF POI to create an excel file in Java. I am able to
set password protection for the whole sheet.
But I need to set it only for a few columns and the others should be
editable.
I checked in Excel and there is an option "Allow Users to Edit Ranges". I
would otherwise like to lock specific cells. I tried the cellstyle locked
but it did not work.
Is this feature available in Jakarta or are there any other APIs that have
this feature.
Please Help.
Thanks
M
--
View this message in context: http://www.nabble.com/Setting-Range-Protection-in-Excel-File-using-Jakarta-POI-tp24399154p24399154.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
Re: Setting Range Protection in Excel File using Jakarta POI
Posted by MSB <ma...@tiscali.co.uk>.
The protection options you can set through the Excel application allow much
more fine grained control over the sorts of protection you can apply to the
contents of your sheets. One possible workaround may be to use a template
file that has the protection set as you want it, to open and populate this
sheet using POI.
Another member of the list did something similar and if you look through the
older messages posted this month for this entry - "Protect workbook for
structure by kevintong" - that may contain the information you are after.
You may even be able to email the OP directly to ask exactly what they did,
as far as I can remember, the only problem they faced as setting the
password once the sheet had been populated.
Yours
Mark B
Daggubati wrote:
>
> I am using Jakarta HSSF POI to create an excel file in Java. I am able to
> set password protection for the whole sheet.
>
> But I need to set it only for a few columns and the others should be
> editable.
>
> I checked in Excel and there is an option "Allow Users to Edit Ranges". I
> would otherwise like to lock specific cells. I tried the cellstyle locked
> but it did not work.
>
> Is this feature available in Jakarta or are there any other APIs that have
> this feature.
>
> Please Help.
>
> Thanks
> M
>
--
View this message in context: http://www.nabble.com/Setting-Range-Protection-in-Excel-File-using-Jakarta-POI-tp24399154p24405040.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
Re: Setting Range Protection in Excel File using Jakarta POI
Posted by Nagineni <na...@yahoo.com>.
Hi,
Even i'm trying for the same feature.To allow some cells to be locked
(uneditable) I followed datavalidation approach infact it is not right way
but done my job.
If you need further information let me know I'll send the sample code for
datavalidation.
Regards,
Naga.
Daggubati wrote:
>
> I am using Jakarta HSSF POI to create an excel file in Java. I am able to
> set password protection for the whole sheet.
>
> But I need to set it only for a few columns and the others should be
> editable.
>
> I checked in Excel and there is an option "Allow Users to Edit Ranges". I
> would otherwise like to lock specific cells. I tried the cellstyle locked
> but it did not work.
>
> Is this feature available in Jakarta or are there any other APIs that have
> this feature.
>
> Please Help.
>
> Thanks
> M
>
-----
Regards,
Naga.
--
View this message in context: http://www.nabble.com/Setting-Range-Protection-in-Excel-File-using-Jakarta-POI-tp24399154p24403458.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