Write Password : Workbook Password « Excel « VBA / Excel / Access / Word






Write Password

 
Sub WritePassword()
    Dim myWorkbook As Workbook, pass As String
    Set myWorkbook = ThisWorkbook
    myWorkbook.Password = ""
    myWorkbook.WritePassword = "Excel2003"
    If myWorkbook.WriteReserved Then _
      Debug.Print "Reserved by: " & myWorkbook.WriteReservedBy
    Debug.Print myWorkbook.BuiltinDocumentProperties("Last Author")
End Sub

 








Related examples in the same category

1.Clear password
2.Set Workbook Password