Answer the question
In order to leave comments, you need to log in
Why the error pops up: You are not allowed to call the user SpreadsheetApp.openById. Required permissions..?
Good afternoon. I write scripts for tables. Everything works well if the functions are run from the newly created menu at the top:
function onOpen(){
var spreadsheet = SpreadsheetApp.getActive();
var menuItems = [
{ name: 'Обновить', functionName: 'Refresh' },
{ name: 'Обновить (интервал 5 сек.)', functionName: 'Refresh5sec' },
{ name: 'Тест (не нажимать)', functionName: 'getSecondary' },
];
spreadsheet.addMenu( 'СКРИПТЫ', menuItems );
}
function onEdit( e ){
var range = e.range;
if( range.getA1Notation() == 'F3' ){
getSecondary();
}
}
Скрипт Google Apps: Exception: Вам не разрешено вызывать пользователя SpreadsheetApp.openById. Необходимые разрешения: https://www.googleapis.com/auth/spreadsheets.
Answer the question
In order to leave comments, you need to log in
The option of creating an installable (full-fledged, uneasy) trigger for editing helped and slightly changed the name of the function so that it does not conflict with the trigger attached to this function (onEdit)
function onEditInstall( e ){
var range = e.range;
if( range.getA1Notation() == 'F3' ){
getSecondary();
}
}
Thanks to Oleg and Alexander Ivanov for the hint
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question