Sorry, I forgot the second bit;

Once you have cretaed HSSFCellStyle objects that allow you to lock the contents 
of certain cells and applied them to those cells, you need to call the 
setProtect(boolean) method of the sheet the cells are on.

--- On Mon, 6/16/08, Anthony Andrews <[EMAIL PROTECTED]> wrote:
From: Anthony Andrews <[EMAIL PROTECTED]>
Subject: Re: Protect or disable a cell
To: "POI Users List" <[email protected]>
Date: Monday, June 16, 2008, 11:02 PM

Not sure if this is what you want but take a look at the HSSFCellStyle class.
That class includes the setLocked(boolean) method and this may do what you
want. At the very least, it is worth a quick test.

Other than that, you could use an on activation macro if you know in advance
which cells require protection.

--- On Mon, 6/16/08, Sascha Schaefer <[EMAIL PROTECTED]>
wrote:
From: Sascha Schaefer <[EMAIL PROTECTED]>
Subject: Protect or disable a cell
To: "POI Users List" <[email protected]>
Date: Monday, June 16, 2008, 7:13 AM

Hi,

 

I want to create an excel workbook and I want to prevent that a user changes
the content of some special cells. I read the POI's API but I haven't
found a solution for my problem. Is there any possibility to disable or protect
some cells of an excel sheet?

 

Mit freundlichem Gruß 

EBCsoft GmbH

Sascha Schäfer

Delitzscher Straße 69

04129 Leipzig

Tel: +49 341 2466261

Fax: +49 341 2466262


      

Reply via email to