OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Change default Cell lock value

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
jvvaleiras
General User
General User


Joined: 18 Oct 2007
Posts: 7

PostPosted: Thu Oct 30, 2008 5:25 am    Post subject: Change default Cell lock value Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group