Aracılığıyla paylaş


WorkbookBase.ProtectWindows Özellik

Windows çalışma kitabının korumalı olup olmadığını gösteren değeri alır.

Ad alanı:  Microsoft.Office.Tools.Excel
Derleme:  Microsoft.Office.Tools.Excel.v4.0.Utilities (Microsoft.Office.Tools.Excel.v4.0.Utilities.dll içinde)

Sözdizimi

'Bildirim
Public ReadOnly Property ProtectWindows As Boolean
public bool ProtectWindows { get; }

Özellik Değeri

Tür: System.Boolean
true çalışma kitabı pencerelerini korunur Aksi halde, false.

Örnekler

Aşağıdaki kod örneğinde Protect , çalışma kitabı ve çalışma kitabı pencerelerini, ancak parola koruması belirtmeden yapısını korumak için yöntem.Örnek daha sonra değerleri denetler ProtectStructure ve ProtectWindows bu koruma ayarlandığını doğrulamak için özellikler.

Bu örnek için belge düzeyi özelleştirmesinde içindir.

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

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

WorkbookBase Sınıf

Microsoft.Office.Tools.Excel Ad Alanı