excel javascript api protect worksheet code example
Example: excel javascript api protect worksheet
Excel.run(function (context) {
var activeSheet = context.workbook.worksheets.getActiveWorksheet();
activeSheet.load("protection/protected");
return context.sync().then(function() {
if (!activeSheet.protection.protected) {
activeSheet.protection.protect();
}
})
}).catch(errorHandlerFunction);