Enabled Property

OCCommand object: Returns a Boolean that represents whether or not the specified command is enabled. Read only.

Protection object: Returns or sets a Boolean that determines whether or not protection is enabled for the specified worksheet. Set this property to True to protect the worksheet. If this property is set to False, the other Protection object property settings are ignored. Read/write.

expression.Enabled

*expression   * Required. An expression that returns an OCCommand or Protection object.

Example

This example prevents a user from inserting rows on the active worksheet.

Sub PreventInsertingRows()

   Dim pt

   Set pt = Spreadsheet1.ActiveSheet.Protection

   pt.AllowInsertingRows = False

   pt.Enabled = True

End Sub

Applies to | OCCommand Object | Protection Object

See Also | AllowDeletingColumns Property | AllowDeletingRows Property | AllowDetails Property | AllowFiltering Property | AllowGrouping Property | AllowInsertingColumns Property | AllowInsertingRows Property | AllowSorting Property | Locked Property