Name

workbook.WriteReserved

Synopsis

Returns True if the workbook has a WritePassword; otherwise, returns False. This property is similar to the HasPassword property, only it checks for a write password. The following code checks if the workbook has a write password and displays the name of the person who set the write password if it does:

    Set wb = ThisWorkbook
    If wb.WriteReserved Then _
      Debug.Print "Reserved by: " & wb.WriteReservedBy

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.