Condividi tramite


Proprietà Workbook.ProtectWindows (System 2007)

Aggiornamento: novembre 2007

Ottiene un valore che indica se le finestre della cartella di lavoro sono protette.

Spazio dei nomi:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Sintassi

Public ReadOnly Property ProtectWindows As Boolean

Dim instance As Workbook
Dim value As Boolean

value = instance.ProtectWindows
public bool ProtectWindows { get; }

Valore proprietà

Tipo: System.Boolean

true se le finestre della cartella di lavoro sono protette; in caso contrario, false.

Esempi

Nell'esempio di codice riportato di seguito viene utilizzato il metodo Protect per proteggere la struttura e le finestre della cartella di lavoro, ma senza specificare una protezione con password. Vengono quindi controllati i valori delle proprietà ProtectStructure e ProtectWindows per verificare che questa protezione sia impostata.

Questo esempio è per una personalizzazione a livello di documento.

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(missing, 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.");
    }
}

Autorizzazioni

Vedere anche

Riferimenti

Workbook Classe

Membri Workbook

Spazio dei nomi Microsoft.Office.Tools.Excel