Set Encryption : Workbook Encryption « Excel « VBA / Excel / Access / Word






Set Encryption

 
Sub SetEncryption()
    Dim myWorkbook As Workbook, pass As String
    Set myWorkbook = ThisWorkbook
    myWorkbook.SetPasswordEncryptionOptions "Microsoft Strong Cryptographic Provider", "RC4", 128, True
End Sub

 








Related examples in the same category

1.Show Encryption Properties