Propriedade WorkbookBase.ProtectStructure

Obtém um valor que indica se a ordem das folhas na pasta de trabalho está protegido.

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

Sintaxe

'Declaração
Public ReadOnly Property ProtectStructure As Boolean
public bool ProtectStructure { get; }

Valor de propriedade

Tipo: System.Boolean
true se a ordem das folhas na pasta de trabalho é protegido; caso contrário, false.

Exemplos

O exemplo de código a seguir usa o método de Protect para proteger a estrutura de pasta de trabalho e do windows de pasta de trabalho, mas sem especificar a proteção de senha.O exemplo verifica então os valores das propriedades de ProtectStructure e de ProtectWindows para verificar que essa proteção está definida.

Este exemplo é para uma personalização da nível.

Private Sub ProtectWorkbook()
    Me.Protect(Structure:=True, Windows:=True)

    If Me.ProtectStructure Then
        MsgBox("You cannot add, delete or change the location " & _
            "of sheets in this workbook.")
    End If

    If Me.ProtectWindows Then
        MsgBox("You cannot arrange windows in this workbook.")
    End If
End Sub
private void ProtectWorkbook()
{
    this.Protect( true, true);

    if (this.ProtectStructure)
    {
        MessageBox.Show("You cannot add, delete or change the location " +
            "of sheets in this workbook.");
    }

    if (this.ProtectWindows)
    {
        MessageBox.Show("You cannot arrange windows in this workbook.");
    }
}

Segurança do .NET Framework

Consulte também

Referência

WorkbookBase Classe

Namespace Microsoft.Office.Tools.Excel