1
votes

I am calling my google apps script function from my google spreadsheet from cell M1. The idea is to set values in many different rows in column L with the setValue call based on a set of custom rules. This spreadsheet is owned by me where I obviously have the edit rights. But I am getting the error "You do not have permission to call setValue". Why is that? Why am I not able to use the setValue to update my own spreadsheet? What is the purpose of setValue then if it cannot be used this way? How can I achieve what I am trying to do other than using setValue? Thanks.

2
Possible duplicate of Google Script setValue permissionRubén

2 Answers

2
votes

From this documentation:

Custom functions return values, but they cannot set values outside the cells they are in. In most circumstances, a custom function in cell A1 cannot modify cell A5. However, if a custom function returns a double array, the results overflow the cell containing the function and fill the cells below and to the right of the cell containing the custom function. You can test this with a custom function containing return [[1,2],[3,4]];.

Maybe you are running the script as a custom function.

You can also check on these related threads:

1
votes

The answer really is to use custom menu. None of the past comments seem to mention how setValue can be used. The setValue is successfully used with custom menu but won't work with custom function.