TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

GetType

GetType() → { ProtectedRangeUserType }

Returns the type property of the current user's information.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ProtectedRangeUserType

Example

Copy code
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");
oProtectedRange.AddUser("uid-2", "Mark Potato", "CanView");
var aUsers = oProtectedRange.GetAllUsers();
oWorksheet.GetRange("A3").SetValue("User type: " + aUsers[0].GetType());
builder.SaveFile("xlsx", "GetType.xlsx");
builder.CloseFile();

Resulting document