jvvaleiras General User

Joined: 18 Oct 2007 Posts: 7
|
Posted: Thu Oct 30, 2008 5:25 am Post subject: Change default Cell lock value |
|
|
Hello.
I'm trying to locka few cells in a sheet of a spreadsheet. I want to lock only a few cells and persist unlocked the other ones. By default all cells have the lock propertie set to true, but i would like to change this. If i can do it i will only set lock propertie to true for a few cells, then lock the sheet and as a result i will obtain a sheet with only a few cells locked.
I'm usgin Java OpenOffice.org API. Some body can help me to change de default lock value to false for all cells in a sheet?
Here a pice of my code;
XCell cell=sheet.getCellByPosition(col, row);
cell.setFormula(value);
XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, cell);
CellProtection cp=new CellProtection();
cp.IsLocked=true;
try {
xCellProps.setPropertyValue("CellProtection",cp);
} catch (PropertyVetoException ex) {
ex.printStackTrace();
} catch (UnknownPropertyException ex) {
ex.printStackTrace();
} catch (WrappedTargetException ex) {
ex.printStackTrace();
} catch (com.sun.star.lang.IllegalArgumentException ex) {
ex.printStackTrace();
}
In this code you can see that I change de lock value of a cell to true, but this is the default value. I would like that the default value were false.
Thanks |
|