Partager via


WorkbookBase.Permission Property

Gets a Microsoft.Office.Core.Permission object that represents the permission settings in the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property Permission As Permission
public Permission Permission { get; }

Property Value

Type: Microsoft.Office.Core.Permission
A Microsoft.Office.Core.Permission object that represents the permission settings in the workbook.

Examples

The following code example uses the Permission property to display a message if permissions are not enabled on the current workbook.

This example is for a document-level customization.

Private Sub DisplayPermission()
    If Not Me.Permission.Enabled Then
        MsgBox("Permissions are not enabled on the current workbook.")
    End If 
End Sub
private void DisplayPermission()
{
    if (!this.Permission.Enabled)
    {
        MessageBox.Show("Permissions are not enabled on the current workbook.");
    }
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace