Google Sheets Script permissions for everyone allowed access to a sheet

末鹿安然 提交于 2020-02-06 08:29:47

问题


I know there are a lot of questions out there related to Google Scripts and some of them touch on my issue but I can't seem to figure out the full answer.

I only want to be able to run 1 or 2 scripts in the same project file for 1 spreadsheet. How do I allow permission for everyone with whom the sheet is shared WITHOUT forcing each user to go through the process of allowing Authorization? Is this possible?

Maybe there is an alternative script? Here is my script (in case this helps):

function onOpen() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet();
  var entries = [{name:"Go to active row", functionName:"Go to active 
row"}];
  sheet.addMenu("Scripts", entries);
myFunction();
};

function gotoend() {
    var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
    var lastRow = sheet.getDataRange().getValues();

lastRow.forEach(function (row,index) {
    if (row[3] == "") {  // row[0] is the same as Column A. row[1] = B
        lastRow.length = index;
    }
});

var newRange = sheet.getRange(lastRow.length,1);
sheet.setActiveRange(newRange);
}
/**
 * @OnlyCurrentDoc
 */

来源:https://stackoverflow.com/questions/49536462/google-sheets-script-permissions-for-everyone-allowed-access-to-a-sheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!