Encrypt and Decrypt Excel files

Using Microsoft Excel

To set file‑encryption settings in Microsoft Excel (e.g., Microsoft Excel 2003):

  1. From the Tools menu, select Options. A dialog will appear.
  2. Select the Security tab.
  3. Input a password and click Advanced.
  4. Choose the encryption type and confirm the password.

Encrypting Excel file with Aspose.Cells

The following example shows how to encrypt and password‑protect an Excel file using the Aspose.Cells for Python via .NET API.

Specifying the “Password to modify” Option

The following example shows how to set the Password to modify option in Microsoft Excel for an existing file using the Aspose.Cells for Python via .NET API.

Decrypting Excel file with Aspose.Cells

It is very easy to open a password‑protected Excel file and decrypt it using the Aspose.Cells for Python via .NET API, as shown in the following code:

Advanced topics