AddUser
function AddUser(
sId: string = null,
sName: string = null,
protectedRangeUserType: ProtectedRangeUserType = null,
): ApiProtectedRangeUserInfo | "null"
Description
Sets a user to the current protected range.
Parameters
- sId
string
null The user ID.
- sName
string
null The user name.
The user type of the protected range.
Returns
ApiProtectedRangeUserInfo | "null"
Try It
var oWorksheet = Api.GetActiveSheet();
oWorksheet.AddProtectedRange("protectedRange", "$A$1:$B$1");
var protectedRange = oWorksheet.GetProtectedRange("protectedRange");
protectedRange.AddUser("userId", "name", "CanView");