GetProtectedRange
Returns a protected range object by its title.
Syntax
expression.GetProtectedRange(sTitle);
expression - A variable that represents a ApiWorksheet class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| sTitle | Required | string | The title of the protected range that will be returned. |
Returns
ApiProtectedRange | null
Example
Get an object that represents the protected range in a spreadsheet.
// How to get protected range in a spreadsheet.
// Get protected range and set its title in a spreadsheet.
let worksheet = Api.GetActiveSheet();
worksheet.AddProtectedRange("protectedRange", "Sheet1!$A$1:$B$1");
let protectedRange = worksheet.GetProtectedRange("protectedRange");
protectedRange.SetTitle("protectedRangeNew");