Name

workbook.PasswordEncryptionAlgorithm

Synopsis

Returns a string indicating the type of encryption used for a workbook. The following code displays the encryption properties for a workbook in the Immediate window:

    Set wb = ThisWorkbook
    Debug.Print "Encrytpion algrorythm: " & wb.PasswordEncryptionAlgorithm, _
      "Encrypt properties? " & wb.PasswordEncryptionFileProperties, _
      "Key length:" & wb.PasswordEncryptionKeyLength, _
      "Provider: " & wb.PasswordEncryptionProvider

If a workbook is not encrypted, the PasswordEncryptionAlgorithm is OfficeStandard.

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.