GetAllProtectedRanges

function GetAllProtectedRanges(): ApiProtectedRange[] | "null"

Description

Returns all protected ranges from the current worksheet.

Returns

ApiProtectedRange[] | "null"

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.AddProtectedRange("protectedRange1", "Sheet1!$A$1:$B$1");
oWorksheet.AddProtectedRange("protectedRange2", "Sheet1!$A$2:$B$2");
var protectedRanges = oWorksheet.GetAllProtectedRanges();
protectedRanges[0].SetTitle("protectedRangeNew1");
protectedRanges[1].SetTitle("protectedRangeNew2");

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).