Sets a user to the current protected range.
Name | Type | Description |
sId | string | The user ID. |
sName | string | The user name. |
protectedRangeUserType | ProtectedRangeUserType | The user type of the protected range. |
builder.CreateFile("xlsx"); var oWorksheet = Api.GetActiveSheet(); oWorksheet.GetRange("A1").SetValue("1"); oWorksheet.GetRange("B1").SetValue("2"); oWorksheet.GetRange("C1").SetValue("3"); oWorksheet.AddProtectedRange("Protected range", "A1:C1"); var oProtectedRange = oWorksheet.GetProtectedRange("Protected range"); oProtectedRange.AddUser("uid-1", "John Smith", "CanEdit"); builder.SaveFile("xlsx", "AddUser.xlsx"); builder.CloseFile();