Do you want to: Ask a how-to question
DocumentBuilder version: 6.4.0-121
Installation method: Installing ONLYOFFICE Docs for Debian, Ubuntu, and derivatives - office en ligne with Nextcloud integration
OS: Ubuntu 18.04
Hi all,
I am trying to achieve the following:
- First, I would like to write a macro to lock some cells or columns, so they can’t be edited (while the macro is active). I understand that in Excel this is possible using the following command:
Range(Target.Address).Locked = True
In OnlyOffice, I tried the following, but it didn’t seem to work:
(function()
{
// Getting the active sheet
activeSheet = Api.GetSheet("Bons expés");
activeSheet.GetRange("C2").Locked = true;
})();
I went through the API, but couldn’t find a method to do that. Is it possible?
- Second, I would like to prevent users from pasting on a specific worksheet. It is possible in Excel to do so using the following code : http://www.vbaexpress.com/kb/getarticle.php?kb_id=373 . However, I couldn’t find a way in the API to perform this action. Does such a way exist?
Thanks for your help.
Best,
Jessica