How to maintain the sheet protected with a password after modification

Hello,

I’m working on protected some cells of one sheet with a password so that only a few people can modify the content of these cells . I already know how to do it by protecting the sheet and then selecting the cells i want to protect. The problem is that if I want to modify the content of a protected cell I need to disable completly the sheet protection and after the modification I need to start again the whole process of creating a new password,etc. Is it possible to make it so that when one wants to change the content of a protected cell he need to enter the password and after he has done it the cell is closed again automatically. If i do it via a macro, the password will be in the code and if the user doesnt activate Macros when he opens the file, it won’t work I guess or if someone have a better solution ?
Thanks
Have a Nice day
P.S : ( The file will be used by many services they all have LibreOffice but I can’t use extern libraries and I’m not allowed to install any additionnal programs in my computer )

You can ask for the password once (Input statement e.g.), and store it temporarily to a global (better private, but this seems to not be implemented correctly) variable which is set to "" (empty) after the second part of the proceeding (onContentChanged for the sensitive cell which first reinstates the sheet protection with the stored password and then clears the variable. If you enter the changed content also via an Input statement, you can avoid the “evil” global variable, and store to a local variable of the called routine. This is surely less fragile
Anyway you shouldn’t trust in data protection based on sheet protection. Many users may need the right to write to the file, and everybody having that right, and knowing how to do it, can circumvent that very weak protection.
Only encryption is actually safe, but it can’t be used during ordinary work with a multi-user file. DataBase software should (can) have a better rights management.