Share via


WorkbookBase.ProtectWindows 속성

통합 문서 창이 보호되는지 여부를 나타내는 값을 가져옵니다.

네임스페이스:  Microsoft.Office.Tools.Excel
어셈블리:  Microsoft.Office.Tools.Excel.v4.0.Utilities(Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

구문

‘선언
Public ReadOnly Property ProtectWindows As Boolean
    Get
public bool ProtectWindows { get; }

속성 값

형식: System.Boolean
통합 문서 창이 보호되면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에서는 Protect 메서드를 사용하여 암호 보호는 지정하지 않고 통합 문서 및 통합 문서 창의 구조만 보호합니다. 그런 다음 ProtectStructure 및 ProtectWindows 속성의 값을 검사하여 암호 보호가 설정되어 있는지 확인합니다.

이 예제는 문서 수준 사용자 지정을 위한 것입니다.

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

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

WorkbookBase 클래스

Microsoft.Office.Tools.Excel 네임스페이스