_Workbook.SetPasswordEncryptionOptions Method
Sets the options for encrypting workbooks using passwords.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Sub SetPasswordEncryptionOptions ( _
PasswordEncryptionProvider As Object, _
PasswordEncryptionAlgorithm As Object, _
PasswordEncryptionKeyLength As Object, _
PasswordEncryptionFileProperties As Object _
)
'Usage
Dim instance As _Workbook
Dim PasswordEncryptionProvider As Object
Dim PasswordEncryptionAlgorithm As Object
Dim PasswordEncryptionKeyLength As Object
Dim PasswordEncryptionFileProperties As Object
instance.SetPasswordEncryptionOptions(PasswordEncryptionProvider, _
PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength, _
PasswordEncryptionFileProperties)
void SetPasswordEncryptionOptions(
Object PasswordEncryptionProvider,
Object PasswordEncryptionAlgorithm,
Object PasswordEncryptionKeyLength,
Object PasswordEncryptionFileProperties
)
Parameters
PasswordEncryptionProvider
Type: System.ObjectOptional Object. A case sensitive string of the encryption provider.
PasswordEncryptionAlgorithm
Type: System.ObjectOptional Object. A case sensitive string of the algorithmic short name (i.e. "RC4").
PasswordEncryptionKeyLength
Type: System.ObjectOptional Object. The encryption key length which is a multiple of 8 (40 or greater).
PasswordEncryptionFileProperties
Type: System.ObjectOptional Object. True (default) to encrypt file properties.
Remarks
The PasswordEncryptionProvider, PasswordEncryptionAlgorithm, and PasswordEncryptionKeyLength arguments are not independent of each other. A selected encryption provider limits the set of algorithms and key length that can be chosen.
For the PasswordEncryptionKeyLength argument there is no inherent limit on the range of the key length. The range is determined by the Cryptographic Service Provider which also determines the cryptographic algorithm.