+ Reply to Thread
Results 1 to 2 of 2

Test if protected

  1. #1
    Steven
    Guest

    Test if protected

    How do you tell if the active file workbook protect is activated? For Sheet
    protect test I have used:

    If ActiveSheet.ProtectContents = True Then ............

    For the Workbook I tried:

    If ActiveWorkbook.ProtectContents = True Then ..........

    But that does not work.

    Thanks for your help,

    Steven

  2. #2
    Chip Pearson
    Guest

    Re: Test if protected

    Steven,

    If ActiveWorkbook.ProtectStructure Or
    ActiveWorkbook.ProtectWindows Then
    Debug.Print "workbook is protected"
    Else
    Debug.Print "workbook not protected"
    End If



    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Steven" <[email protected]> wrote in message
    news:[email protected]...
    > How do you tell if the active file workbook protect is
    > activated? For Sheet
    > protect test I have used:
    >
    > If ActiveSheet.ProtectContents = True Then ............
    >
    > For the Workbook I tried:
    >
    > If ActiveWorkbook.ProtectContents = True Then ..........
    >
    > But that does not work.
    >
    > Thanks for your help,
    >
    > Steven




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1