I have issue with protect worksheet in excel online. I will unlock all of the cells in the worksheet, and lock one range, then protect worksheet, after that nothing is editable in the worksheet, even the cells are unlocked.This issue only happens for excel online version, works fine for installed desktop version. Anyone has idea how to solve the problem or the is an officeJs bug?
Excel.run(function (ctx) {
//Worksheet
var sheet = ctx.workbook.worksheets.getItem("Sheet1");
//Entire Range
var entireRange = sheet.getRange();
entireRange.format.protection.locked = false;
//Specific Range
var range = sheet.getRange("A1:B5");
range.format.protection.locked = false;
//Protect Entire sheet
sheet.protection.protect({
allowInsertRows: false,
allowDeleteRows: false
});
return ctx.sync();
}).catch(errorHandler);