Re: [libreoffice-users] Locking a single cell in a Calc sheet using a macro
Using styles I get it to work. It's a pity though that one can't simply set isLocked. Graham On 19 July 2012 13:35, Johnny Rosenberg wrote: > 2012/7/19 Graham Luffrum : > > 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+h...@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+h...@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
Re: [libreoffice-users] Locking a single cell in a Calc sheet using a macro
2012/7/19 Graham Luffrum : > 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+h...@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
Re: [libreoffice-users] Locking a single cell in a Calc sheet using a macro
On 19/07/12 11:19, Graham Luffrum wrote: 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 Way outside my own skills - but does http://user.services.openoffice.org/en/forum/viewtopic.php?f=9&t=34393 give insight? (Googling for 'openoffice CellProtection.IsLocked' came up with several likely-looking hits. Although one said it couldn't be done :-{ ) -- Mike Scott Harlow, Essex, England -- For unsubscribe instructions e-mail to: users+h...@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
[libreoffice-users] Locking a single cell in a Calc sheet using a macro
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 -- For unsubscribe instructions e-mail to: users+h...@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