Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sheet.getProtections no longer works?

I have a script that automatically protects a range of past Dates in my Sheet.

I use the standard sheet.getProtections(SpreadsheetApp.ProtectionType.RANGE);

It worked fine for several months but it has not worked since yesterday.

Is there any modifications on the implementations ?

Thank you

PS : the sheet object is well returned in my tests

var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("TRAVAUX");
var debug = sheet.getName();
var protections = sheet.getProtections(SpreadsheetApp.ProtectionType.RANGE);

Error message when running the function

Service error: Spreadsheets

like image 309
fdoc Avatar asked Feb 06 '20 10:02

fdoc


People also ask

How do I get the last row in Google Sheets app script?

//To get last row of the sheet. var LastRowOfSheet = SpreadsheetApp. getActive(). getActiveSheet().

How do you delete a worksheet app script?

Click the name of the script in the left-hand box alongside the script text in the text editor to highlight it. Select the "File" menu and then click "Delete."

What does SpreadsheetApp getActiveSheet do?

getActiveSpreadsheet()Returns the currently active spreadsheet, or null if there is none. Functions that are run in the context of a spreadsheet can get a reference to the corresponding Spreadsheet object by calling this function.

How do I rename a sheet in Google Apps Script?

To rename a sheet in a Google Sheets spreadsheet, we will use the setName() method of the Sheet object. The function renameSheet() accepts two parameters: (1) the current name of the sheet and (2) its new name.


1 Answers

There seem to be several developers with this problem, it might be a bug or a temporary problem.

The issue has been reported on Public Issue Tracker. Give it a "star" to indicate that you are also affected.

like image 121
ziganotschka Avatar answered Oct 05 '22 16:10

ziganotschka