• Register
0 votes
36 views

Problem :

I am having some very strange problems with the protection in Google New Sheets.

I have protected my sheet for edit by owner only except for the rows 5 to 7 using the 'Sheet protect except certain cells' function under the 'Data - Protected sheets and ranges...'

I have also used the simple User Function menu which can be invoked on open that contains the simple Google Apps Script that will insert a given number of rows. The following things are happening when the other user tries to access the sheet:

1.      The basic protection seems works as expected. The other user can only edit the rows 5 to 7.

2.      The insert row function which I selected under User Functions menu produces the 'Service error: Spreadsheets'.

3.      And if the other user tries to delete any of the 3 unprotected rows then the message as follows: 'Can't save your changes. Copy any recent changes, then revert to an earlier version...'  will appear in the red box at the top of the screen. By clicking on the top 'revert to an earlier version...' link will reverse the delete.

If I remove all the protection then everything is 100% for the other user - insert rows function - delete rows etc.

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

You need to set up the project trigger for onOpen() rather than the use of  the simple onOpen(). Then it will run with the required privileges rather than those of the current user. So just click on the Resources/Current Project Triggers and add a new trigger. And you are sorted.

9 7 4
38,600 points

Related questions

0 votes
1 answer 134 views
134 views
Problem : How can I ignore the below error message on the Git pull? Your local changes to the following files would be overwritten by merge What if I just want to overwrite them? I Have already tried many things like git pull -f, but nothing really works for me.To be very clear, I just want to overwrite the specific changes and not the everything.
asked Jan 2, 2020 alecxe 7.5k points
0 votes
2 answers 163 views
163 views
Problem : I have the project with two branches as staging and beta. I try to develop on staging, and use my master branch to fix the bugs. git checkout master And do the stuff on it : git add fileToAdd git commit -m "bug fixed ... be overwritten by checkout: src/Pro/ConvocationBundle/Controller/DefaultController.php Please, commit your changes or stash them before you can switch branches. Aborting
asked Dec 18, 2019 alecxe 7.5k points
0 votes
1 answer 3.2K views
3.2K views
Problem : As I am allowing the USB debugging, when I tap on OK button, the Messaging pops up as follows: Because an app is obscuring a permissions request, Settings can't verify your response The above error is coming in allowing USB debugging.
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 68 views
68 views
Problem : I am getting bellow error if we're in the real pre-commit handler we can't actually add any new fences due to ca restriction
asked Nov 7, 2019 peterlaw 6.9k points
0 votes
1 answer 8 views
0 votes
1 answer 1.7K views
1.7K views
Problem : I made some of the updates on my local machine, pushed them to the remote repository, and now I want to pull my changes to the server and I get a message; error: Your local changes to the following files would be overwritten by merge: wp-content/w3tc-config/master.php ... is the best), I just want to be able to merge a rest of my changes (plugin updates). Any clues how can I resolve it?
asked Jan 21, 2020 jwilliam 3.9k points
0 votes
1 answer 8 views
8 views
Problem: The program deals with an ATM, which has 5 options: 1 check balance. 2 Withdraw money. 3 Deposit money. 4 show last 5 movements. 5 exit. My problem is in the last 5 movements, since I must save the data, that is, the inquiries withdrawals and deposits that the user makes, with ... in a moment ...." << endl; Sleep (10000); system ("cls"); menu_of_operations (); break; } } while (opc <5); }
asked Nov 5, 2020 sasha 5.3k points
0 votes
1 answer 17 views
17 views
I have to read a file that has this format: Id: 23 Name: Roberto Last Name: My Last Name Id: 24 Name: Roberto2 Last Name: My Last Name2 And I have to read that file to be able to work with that data but I don't know how to read it. I have a struct created as follows: struct Data {      int Id;      string Name;      string Surname; }; How do I go about having that data in an array?
asked Aug 17, 2020 game 4.6k points
0 votes
1 answer 9 views