Unprotect the excel sheet with password pro-grammatically using officejs.
1 - 1 of 1 records
Summary

await Excel.run(async function(context) {

 

const sheet = context.workbook.worksheets.getActiveWorksheet();

// const workBook = context.workbook.

console.log(sheet.protection);

sheet.protection.unprotect("abc")

const range = sheet.getUsedRange();

range.load("values");

range.load("address");

return context.sync().then(function () {

console.log(range.address);

})

}).catch(function(error) {

console.log("Error: " + error);

 

});

 

Giving Error:

Uncaught (in promise): InvalidArgument: The argument is invalid or missing or has an incorrect format.