How to make read only row in spreadsheet using Google Apps Script? -
i have form response sheet, , wanted make row in read only
mode. how can achieve using google apps script or alternate methods available same.
thank you!
two ways solve this:
apps script
you want use protection class of spreadsheet (documentation). allows access built-in cell protection mechanisms. here's example form documentation making range read-only:
// protect range a1:b10, remove other users list of editors. var ss = spreadsheetapp.getactive(); var range = ss.getrange('a1:b10'); var protection = range.protect().setdescription('sample protected range'); // ensure current user editor before removing others. // otherwise, if user's edit permission comes group, // script throw exception upon removing group. protection.removeeditors(protection.geteditors()); if (protection.candomainedit()) { protection.setdomainedit(false); } // range not editable anyone. // add editors list if necessary. protection.addeditor(session.geteffectiveuser());
in sheets app
you can access cell & range protection mechanisms within sheets app via data
menu. select data
>protect sheets , ranges...
, set permissions in side-bar.
Comments
Post a Comment