Name
workbook.SetPasswordEncryptionOptions(PasswordEncryptionProvider, PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength, PasswordEncryptionFileProperties)
Synopsis
Sets the workbook’s encryption properties.
|
Argument |
Settings |
|---|---|
|
|
A string containing the full name of the encryption provider, such as |
|
|
A string containing the type of encryption to use. Use |
|
|
The length of the encryption key. Must be a valid value for the encryption provider. |
|
|
Set to True to encrypt the workbook’s file properties, False to leave them unencrypted. |
The following code sets strong encryption on a workbook:
Set wb = ThisWorkbook
wb.SetPasswordEncryptionOptions "Microsoft Strong Cryptographic Provider", _
"RC4", 128, TrueBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access