Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi :)
Did you manage to solve this problem in the end?  I'm not sure if the 3rd party guides here could 
help
https://wiki.documentfoundation.org/Documentation/Publications#Programmers
Regards from
Tom :)


--- On Mon, 19/3/12, James E. Lang <jim+lou@lang.hm> wrote:

From: James E. Lang <jim+lou@lang.hm>
Subject: [libreoffice-users] Sheet Protection in Calc
To: users@global.libreoffice.org
Date: Monday, 19 March, 2012, 8:07

I need help finding the programatic technique to access a new LibreOffice Calc feature.

LibreOffice Calc has a feature that is absent in OpenOffice.org relating to protection within a 
sheet. Try Alt+T, P, S on an unprotected sheet. You will see a box where you can check "Protect 
this sheet and the contents of protected cells". You can also enter a password and confirm it. The 
new feature is that you can select either, both, or neither of two options dealing with allowing 
all users of this sheet to select protected or unprotected cells. Finally there are three buttons 
-- OK, Cancel, and Help. Use the OK button to activate your selections. You can restore the 
unprotected sheet mode by simply using Alt+T, P, S once again.


The upper half of the dialog box that I just described is available in OpenOffice.org also but the 
lower half dealing with the options regarding permission to select cells has been added in 
LibreOffice. This is a great addition but I have not yet found a way to influence the option 
settings from within a LibreOffice Basic Macro. Is a feature request needed or does this feature 
already exist? I don't know how to submit a feature request if that is needed. I hope that when the 
feature was added to the menu that access to it was also added to the Macro interface and that I 
just have not seen the documentation spelling out how to utilize it.

The technique that I know to programatically establish sheet protection is this:

   oSheet.protect("password")

The easiest implementation I can think of to add these two options is to expand that command to 
include two boolean parameters -- one corresponding to each of the two option checkmarks in the 
dialog box. Example which is equivalent to the default.

   oSheet.protect("password",TRUE,TRUE)

I currently have access to LibreOffice 3.5.0 Build ID:350m1(Build:13) on Linux and LibreOffice 
3.4.5 OOO340m1 (Build:502) on Windows.

-- Jim


-- For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


-- 
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.