I have two cells merged into one in Excel.
Also, I have given the range name to it.
In code (js), I am trying to lock the cells in the group:
Excel.run(function (ctx) {
var s = ctx.workbook.worksheets.getActiveWorksheet();
return ctx.sync()
.then(() => {
var cell = s.getRange("dateFrom");
cell.format.protection.locked = true;
ctx.sync();
});
}).catch(errorHandler);
The issue seems to be that only the first cell from left in this group is getting locked and the second does not. As a result of this, the grouped/merged cell is set to locked=null
Any idea how to get over this problem?
It seems to be working fine when using the exact range definition (not a range names) - "B5:C5".
Regards, M.


Aucun commentaire:
Enregistrer un commentaire