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


2012/7/19 Graham Luffrum <grhmlffrm@gmail.com>:
Hi,

I am trying to write a macro that will, amongst other things, lock a single
cell in a Calc sheet.  I can easily test to see if the cell is locked,
using "CellProtection.IsLocked", but I don't see how to change the value.

Any ideas?

Graham

I tried to just set IsLocked to False and True, but I guess you tried
that too, because nothing happened:

ThisComponent.getSheets().getByIndex(0).getCellByPosition(0,0).cellProtection.IsLocked=False
' Nothing happens

I found this thread in a forum, however:
http://user.services.openoffice.org/en/forum/viewtopic.php?f=9&t=34393

They also suggest to manipulate IsLocked, which obviously doesn't
work, at least not with LibreOffice Calc 3.5.5. However, they also
suggest using two different cell styles, one unlocked and one locked,
and apply them with a macro. I didn't test that, but take a look
yourself.

Still, I wonder why IsLocked didn't work. On the other hand, if it
worked, I suppose there would be a method for it, like
CellProtection.Lock() or something like that.


Kind regards

Johnny Rosenberg
ジョニー・ローゼンバーグ

-- 
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.