Google Apps Script taken over from predecessor does not work with permission error?

Asked 2 years ago, Updated 2 years ago, 102 views

Thank you for your help.
The script I took over from my predecessor didn't work, and I didn't know, but I debugged the execution.

Authorization required Untitled project needs your permission to access your data on Google

When I clicked "Allow" when it was displayed,

appears.

The author's Google account has already been deleted.
What kind of changes do I need to make to work from here?

The code is as follows.Each definition name was defined in a separate gs file, but
I didn't see any mention of the retiree's account.

//* What to do when the file is opened?
// * Select the bottom row of the sheet.
// * (Because it's troublesome to scroll to the bottom every time...)
// */
function onOpen() {
  if(SpreadsheetApp.getActiveSheet().getSheetName()!=SHEET_NAME_INQUIRY){
    return;
  }

  SpreadsheetApp.getActiveSheet().setActiveSelection("B" + getLastRow("B")); 
  SpreadsheetApp.getActiveSpreadsheet().toast("Cursor moved to bottom line";
}
//
///**
// * Get bottom row
// * column —Column name
// */
function getLastRow(column){
  var lastRow=SpreadsheetApp.getActiveSheet().getMaxRows();
  var values = SpreadsheetApp.getActiveSheet().getRange(column+"1:"+column+lastRow).getValues();

  for(;values[lastRow-1]==""&lastRow>0;lastRow--){}
  return lastRow;
}

google-apps-script

2022-09-30 21:45

1 Answers

The easiest way is to copy and operate the spreadsheet.Each spreadsheet is linked to a GCP project, so deleting an agent's account will cause this error.

If it has to be that spreadsheet, it will work if you create the project on the GCP side again and connect it manually.There are quite a few steps, so please do your best.

Consolidation Steps
https://00m.in/Symh7


2022-09-30 21:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.