返回在对指定的工作簿编写密码时,Microsoft Excel 使用的算法加密提供程序的名称。String 类型,只读。
expression.PasswordEncryptionProvider
expression 必需。该表达式返回“应用于”列表中的对象之一。
如果具有密码保护的工作簿的文件属性没有加密,则本示例设置指定工作簿的密码加密选项。
Sub SetPasswordOptions()
With ActiveWorkbook
If .PasswordEncryptionProvider <> "Microsoft RSA SChannel Cryptographic Provider" Then
.SetPasswordEncryptionOptions _
PasswordEncryptionProvider:="Microsoft RSA SChannel Cryptographic Provider", _
PasswordEncryptionAlgorithm:="RC4", _
PasswordEncryptionKeyLength:=56, _
PasswordEncryptionFileProperties:=True
End If
End With
End Sub