79605555

Date: 2025-05-04 11:20:38
Score: 0.5
Natty:
Report link

ExcelScript.WorksheetProtection interface , instead of

  // Pause sheet protection with a password if needed
  if (ws.getProtection().getProtected()) {
    ws.getProtection().unprotect(shtPW);
  }

use (see the link for the entire code):

  const protection: ExcelScript.WorksheetProtection = sheet.getProtection();
  
  // Check if the provided password works.
  if (protection.checkPassword(password)) {
    protection.pauseProtection(password);
Reasons:
  • RegEx Blacklisted phrase (1): see the link
  • Probably link only (1):
  • Has code block (-0.5):
  • High reputation (-1):
Posted by: Michal