返回 Microsoft Excel 对指定的工作簿编写密码时使用的算法。String 类型,只读。
expression.PasswordEncryptionAlgorithm
expression 必需。该表达式返回“应用于”列表中的对象之一。
使用 SetPasswordEncryptionOptions 方法可指定 Excel 是否对具有密码保护的工作簿的文件属性进行加密。
本示例设置活动工作簿的密码加密选项。
Sub SetPasswordOptions()
ActiveWorkbook.SetPasswordEncryptionOptions _
PasswordEncryptionProvider:="Microsoft RSA SChannel Cryptographic Provider", _
PasswordEncryptionAlgorithm:="RC4", _
PasswordEncryptionKeyLength:=56, _
PasswordEncryptionFileProperties:=True
End Sub