跳到主要内容

DeleteUser

Removes a user from the current protected range.

Syntax

expression.DeleteUser(sId);

expression - A variable that represents a ApiProtectedRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sIdRequiredstringThe user ID.

Returns

boolean

Example

This example changes the the user protected range.

let worksheet = Api.GetActiveSheet();
worksheet.AddProtectedRange("protectedRange", "$A$1:$B$1");
let protectedRange = worksheet.GetProtectedRange("protectedRange");
protectedRange.AddUser("userId", "name", "CanView");
protectedRange.DeleteUser("userId");