Enabled Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
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