Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Thanked 0 Times in 0 Posts

    Program control of encrypting a file (Excel 2000, XP, 2003, and Offcie 12)

    When you save an Excel file using "Save As" you have the option to secure it at this point. When the "Save As" dialog appears you will see in the upper right corner a "Tools" item. Select it and then select "General Options" which will bring up a dialog askign for an "Open" password and an "Edit" password. There is an "Advance" button next to the open password edit box, select it. This brings up the Encryption dialog that allows te user to encrypt the file.

    My question is is there an API that allows one to write code to do this rather the user doing it manually?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Program control of encrypting a file (Excel 2000, XP, 2003, and Offcie

    I can only check in Excel 2002 (XP). The Workbook object has a SetPasswordEncryptionOptions method with arguments PasswordEncryptionProvider, PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength, and PasswordEncryptionFileProperties. Here is the example from the Excel VBA help:

    ActiveWorkbook.SetPasswordEncryptionOptions _
    PasswordEncryptionProvider:="Microsoft RSA SChannel Cryptographic Provider", _
    PasswordEncryptionAlgorithm:="RC4", _
    PasswordEncryptionKeyLength:=56, _

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts