Enabled Property

Microsoft Office Web Components Visual Basic

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