SetAnyoneType
function SetAnyoneType(protectedRangeUserType: ProtectedRangeUserType = null): bool
Description
Sets the type of the "Anyone" user to the current protected range.
Parameters
The user type of the protected range.
Returns
bool
Try It
var oWorksheet = Api.GetActiveSheet();
oWorksheet.AddProtectedRange("protectedRange", "Sheet1!$A$1:$B$1");
var protectedRange = oWorksheet.GetProtectedRange("protectedRange");
protectedRange.SetAnyoneType("CanView");