Bonsoir,
J'ai récupéré ce script :
function onOpen() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0];
if (protection && protection.canEdit()) {
protection.remove();
} else {
var password = Browser.inputBox('Enter the password to protect the sheet:');
if (password != 'password') {
Browser.msgBox('Incorrect password. Please try again.');
return;
}
var range = sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns());
protection = range.protect().setDescription('Protected range');
protection.removeEditors(protection.getEditors());
if (protection.canDomainEdit()) {
protection.setDomainEdit(false);
}
}
}
Le script se lance mais ne se termine pas et je ne sais pas d'ou vient l'erreur; quelqu'un pourrait m'aider; merci à tous.