A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Please delete this post. I found a different solution. Thanks.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Appreciate any help on this. I am working with Excel app online. I have made a script to clear contents (and make other adjustments) to certain cells. The sheet is protected with the selected cells as unprotected. The script works fine when the sheet is unprotected, but has error when the sheet is protected. To accommodate this, I have tried to enter code to unprotect/pause protection when the script is run. I managed to get that to work, however, each time a pop-up window appears asking for the password. I want to find a way to have the password in the script itself and not do the pop-up prompt. Here is a slimmed down version of my script :
function main(workbook: ExcelScript.Workbook, password: string) {
let selectedSheet = workbook.getActiveWorksheet();
password="12345";
protection.pauseProtection(password);
// selectedSheet.Unprotect("12345");
selectedSheet.getRange("D3:E3").clear(ExcelScript.ClearApplyTo.contents);
// selectedSheet.Protect("12345");
protection.resumeProtection(password);
}
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Please delete this post. I found a different solution. Thanks.