Forum Discussion
How to add Parameters in Worksheet Protection? Office Scripts
How can I allow formatting of columns? I tried to insert the WorksheetProtectionOptions but I keep failing.
function main(workbook: ExcelScript.Workbook) {
let sheet = workbook.getWorksheet("By Item");
sheet.getProtection().protect(ExcelScript.WorksheetProtectionOptions.allowFormatColumns);
}
Here is the link.
https://docs.microsoft.com/en-us/javascript/api/office-scripts/excelscript/excelscript.worksheetprotection?view=office-scripts#protect-options--password-
Thanks for the post. I replied here - https://stackoverflow.com/questions/64393820/protect-worksheet-in-office-scripts-with-options/64395382#64395382
5 Replies
- Sudhi RamamurthyFormer Employee
Thanks for the post. I replied here - https://stackoverflow.com/questions/64393820/protect-worksheet-in-office-scripts-with-options/64395382#64395382
- NikolinoDEPlatinum ContributorI was pleased that I could help you at least indirectly.
I wish you a nice day / night with lots of health, joy and love.
Thank you for your patience and time.
Nikolino
I know I don't know anything (Socrates)
- NikolinoDEPlatinum Contributor
I'm not familiar with Excel Online, but here is a little bit of information that might help you in your plans. If not please just ignore it.
You cannot create a sheet protection in the WebApp and you cannot remove any existing sheet protection. However, you can now upload folders with protected sheets and since this update they can also be opened. Editing is possible as far as the set protection allows. I have learned that so far, but if it is different, I am very happy to be taught.
Edit a workbook that contains features unsupported by Excel for the web
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)
- Erut313Brass Contributor
NikolinoDE This did not help.
- NikolinoDEPlatinum Contributor
Certainly not the right person to help you with Javascript. But I would like to provide you with information that might help you. If not please just ignore my post.
Thank you for your time and patience and wish you much success in your project.var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("TRAVAUX"); var debug = sheet.getName(); var protections = sheet.getProtections(SpreadsheetApp.ProtectionType.RANGE);https://stackoverflow.com/questions/60092877/sheet-getprotections-no-longer-works
Nikolino
I know I don't know anything (Socrates)