The Protection Object

When you protect a worksheet, Excel permits you to specify that certain operations are still permitted on unlocked cells. At the user level, this is done through the Protection dialog box. At the programming level, it is done through the properties of the Protection object. Most of these properties (listed below) are self-explanatory. Note that all of these properties except AllowEditRanges are Boolean.

• AllowDeletingColumns

• AllowDeletingRows

• AllowEditRanges

• AllowFiltering

• AllowFormattingCells

• AllowFormattingColumns

• AllowFormattingRows

• AllowInsertingColumns

• AllowInsertingHyperlinks

• AllowInsertingRows

• AllowSorting

• AllowUsingPivotTables

For example, if the AllowSorting property is True, then users can still sort unlocked cells in a protected worksheet.

The AllowEditRanges property returns an AllowEditRanges object, discussed separately in the text.

0 0

Post a comment