EasyXLS

Password protected Excel file and encryption

EasyXLS™ library enables you to protect your Excel file from unauthorized access by setting passwords for opening or / and modifying the document. If you set the password for opening the file, the Excel file will be encrypted.

EasyXLS allows you to create password protected Excel files and also to read password protected Excel files.

The library also provides methods for protecting the workbook structure and windows. An optional password can be set for this purpose. If the workbook is protected, the Excel file will be encrypted. The library allows you to create encrypted Excel files and also to read encrypted Excel files.

For Office 97-2003 documents, you may choose between RC4 (default encryption) or XOR (weak encryption). The default encryption for Office 2007-2013 documents is AES (Advanced Encryption Standard).

Password to open Excel file

EasyXLS allows you to set a password for opening the Excel file using ExcelOptions.setPasswordToOpen method. If password set, the Excel file is encrypted.

The below source code sample shows how to create a password protected Excel file. The exported file is encrypted and a password is set for opening the Excel file.

C#.NET
VB.NET
C++
Java
PHP
ASP
VB6
VBS
Coldfusion
Python

The screen shot provides an example of a password protected Excel file and the password window to enter the required password for opening the file.

Create and read password protected Excel file

Create XLSX, XLSB, XLSM and XLS password protected Excel files

This code sample shows how to create a password protected XLSX file. Similarly, you can create password protected XLS files using ExcelDocument.easy_WriteXLSFile method or create password protected XLSB files using ExcelDocument.easy_WriteXLSBFile method.

Read XLSX, XLSB, XLSM and XLS password protected Excel files

EasyXLS allows you to read password protected Excel files, if the password is known and it is set before using any method that loads Excel file or reads data from Excel file. You can set the password for reading password protected XLSX or XLSM file and use ExcelDocument.easy_LoadXLSXFile method, read password protected XLS file and use ExcelDocument.easy_LoadXLSFile method or read password protected XLSB file using ExcelDocument.easy_LoadXLSBFile.

The below source code sample shows how to load a password protected Excel file.

C#.NET
VB.NET
C++
Java
PHP
ASP
VB6
VBS
Coldfusion
Python

Password to modify Excel file

EasyXLS allows you to set a password for modifying the Excel file using ExcelOptions.setPasswordToModify method.

Password protected workbook

EasyXLS allows you to protect the workbook structure and windows with a password using ExcelDocument.setWorkbookProtection method and ExcelDocument.setWorkbookPassword method. If the workbook is protected, the Excel file will be encrypted.

C#.NET
VB.NET
C++
Java
PHP
ASP
VB6
VBS
Coldfusion
Python

Encrypted Excel file and encryption algorithm

If a password is set for opening the Excel file or if the workbook is protected the Excel file is encrypted. EasyXLS supports Agile Encryption, AES (Advanced Encryption Standard) for MS Excel 2007 or later files, RC4 or XOR (weak encryption) for Excel 97-2003 files. The latest encryption algorithm that is compatible with the current Excel file format is used by default.The encryption algorithm can be set using ExcelOptions.setEncryptionOptions method.

The below source code sample shows how to change the default encryption algorithm.

C#.NET
VB.NET
C++
Java
PHP
ASP
VB6
VBS
Coldfusion
Python

Getting started with EasyXLS Excel library

To download the trial version of EasyXLS Excel Library, press the below button:

Download EasyXLS™ Excel Library for .NET and Java

If you already own a license key, you may login and download EasyXLS from your account.



Available for: Professional, Excel Writer, Excel Reader
Go to top

EasyXLS Excel libraries:

.NET
.NET Excel Library
full .NET version to import, export or convert Excel files
COM+ Excel Library
full COM+ version to import, export or convert Excel files
-
Java
Java Excel Library
full Java version to import, export or convert Excel files
Download EasyXLS™ Excel Library for .NET and Java

File formats:

Office 365
MS Excel 2021 - 2024
MS Excel 2007 - 2019
MS Excel 97 - 2003
XLSXXLSMXLSBXLS
XMLHTMLCSVTXT