ExcelScript.AllowEditRange interface

Represents an AllowEditRange object found in a worksheet. This object works with worksheet protection properties. When worksheet protection is enabled, an AllowEditRange object can be used to allow editing of a specific range, while maintaining protection on the rest of the worksheet.

Methods

delete()

Deletes the object from the AllowEditRangeCollection. Worksheet protection must be disabled or paused for this method to work properly. If worksheet protection is enabled and not paused, this method throws an AccessDenied error and fails the delete operation.

getAddress()

Specifies the range associated with the object.

getIsPasswordProtected()

Specifies if the object is password protected.

getTitle()

Specifies the title of the object.

pauseProtection(password)

Pauses worksheet protection for the object for the user in the current session. This method does nothing if worksheet protection isn't enabled or is already paused. If worksheet protection cannot be paused, this method throws an UnsupportedOperation error and fails to pause protection for the object. If the password is incorrect, then this method throws a BadPassword error and fails to pause protection for the object. If a password is supplied but the object does not require a password, the inputted password will be ignored and the operation will succeed.

setAddress(address)

Specifies the range associated with the object. Worksheet protection must be disabled or paused for this method to work properly. If worksheet protection is enabled and not paused, this method throws an AccessDenied error and fails to set the range.

setPassword(password)

Changes the password associated with the object. Setting the password string as empty ("") or null will remove password protection from the object. Worksheet protection must be disabled or paused for this method to work properly. If worksheet protection is enabled and not paused, then this method throws an AccessDenied error and the set operation fails.

setTitle(title)

Specifies the title of the object. Worksheet protection must be disabled or paused for this method to work properly. If worksheet protection is enabled and not paused, this method throws an AccessDenied error and fails to set the title. If there is already an existing AllowEditRange with the same string, or if the string is null or empty (""), then this method throws an InvalidArgument error and fails to set the title.

Method Details

delete()

Deletes the object from the AllowEditRangeCollection. Worksheet protection must be disabled or paused for this method to work properly. If worksheet protection is enabled and not paused, this method throws an AccessDenied error and fails the delete operation.

delete(): void;

Returns

void

getAddress()

Specifies the range associated with the object.

getAddress(): string;

Returns

string

getIsPasswordProtected()

Specifies if the object is password protected.

getIsPasswordProtected(): boolean;

Returns

boolean

getTitle()

Specifies the title of the object.

getTitle(): string;

Returns

string

pauseProtection(password)

Pauses worksheet protection for the object for the user in the current session. This method does nothing if worksheet protection isn't enabled or is already paused. If worksheet protection cannot be paused, this method throws an UnsupportedOperation error and fails to pause protection for the object. If the password is incorrect, then this method throws a BadPassword error and fails to pause protection for the object. If a password is supplied but the object does not require a password, the inputted password will be ignored and the operation will succeed.

pauseProtection(password?: string): void;

Parameters

password

string

The password associated with the AllowEditRange object.

Returns

void

setAddress(address)

Specifies the range associated with the object. Worksheet protection must be disabled or paused for this method to work properly. If worksheet protection is enabled and not paused, this method throws an AccessDenied error and fails to set the range.

setAddress(address: string): void;

Parameters

address

string

Returns

void

setPassword(password)

Changes the password associated with the object. Setting the password string as empty ("") or null will remove password protection from the object. Worksheet protection must be disabled or paused for this method to work properly. If worksheet protection is enabled and not paused, then this method throws an AccessDenied error and the set operation fails.

setPassword(password?: string): void;

Parameters

password

string

The password associated with the AllowEditRange object.

Returns

void

setTitle(title)

Specifies the title of the object. Worksheet protection must be disabled or paused for this method to work properly. If worksheet protection is enabled and not paused, this method throws an AccessDenied error and fails to set the title. If there is already an existing AllowEditRange with the same string, or if the string is null or empty (""), then this method throws an InvalidArgument error and fails to set the title.

setTitle(title: string): void;

Parameters

title

string

Returns

void