0
votes

I am trying to use the protect mehtod of Worksheet Protection in Excel client in IOS

https://github.com/OfficeDev/office-js-docs/blob/master/reference/excel/worksheetprotection.md#protectoptions-worksheetprotectionoption

its works fine if i dont use the option argument in protect method, https://github.com/OfficeDev/office-js-docs/blob/master/reference/excel/worksheetprotectionoptions.md#loadparam-object

but i need allowFormatCells option to be set to true, with this option its not working correctly in Excel client in IOS IPad, i get error as InValid argument.

This method works fine in Windows environment.

Please let me know how to workaround this.

function protectWorksheet() {
        Excel.run(function (ctx) {
            var sheet = ctx.workbook.worksheets.getItem("Sheet1");
            var range = sheet.getRange("A1:B3").format.protection.locked = false;
            //sheet.protection.protect({ allowInsertRows: true });
            sheet.protection.protect({ allowFormatCells: true });
            return ctx.sync();
        }).catch(function (error) {
            console.log("Error: " + error);
            if (error instanceof OfficeExtension.Error) {
                console.log("Debug info: " + JSON.stringify(error));
            }
        });
    }
1

1 Answers

1
votes

This sounds like a bug -- we are investigating, and will update the thread once we have more info.