Name

workbook.WritePassword [= setting]

Synopsis

Sets the workbook’s Password to Modify setting in Excel. Always returns "********". The following code removes a workbook’s Password to Open setting (read/write) and creates a read-only password:

    Set wb = ThisWorkbook
    wb.Password = ""
    wb.WritePassword = "Excel2003"

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.