Excel Encryption for XLSX in Java

XLSX encryption enables you to securely protect the content of your Excel workbook (XLSX) from unwanted viewers.

Following example shows how to load encrypted XLSX file and how to save workbook as encrypted XLSX file in Java.

Input and output password should be specified in the appropriate text box. If password is empty, file won't be decrypted / encrypted.

XLSX Encryption Screenshot
Upload your file (Drag file here)
import com.gembox.spreadsheet.*;

class Program {

    public static void main(String[] args) throws java.io.IOException {
        // If using Professional version, put your serial key below.

        String inputPassword = "%InputPassword%";
        String outputPassword = "%OutputPassword%";

        XlsxLoadOptions loadOptions = new XlsxLoadOptions();
        ExcelFile ef = ExcelFile.load("%InputFileName%", loadOptions);

        XlsxSaveOptions saveOptions = new XlsxSaveOptions();
        ef.save("XLSX Encryption.xlsx", saveOptions);

Check next example or download examples from GitHub.