Skip to main content

Secure Excel file using n8n action

PDF4me Secure Excel applies comprehensive password protection to Excel documents through n8n automation workflows with multi-level security control. Process Excel files via n8n triggers, binary data, base64 strings, or public URLs to protect at three independent levels: file encryption (password to open), workbook structure protection (prevent sheet modifications), and worksheet content protection (prevent cell edits), with flexible password hierarchy allowing separate passwords for each level or single password for all, plus selective worksheet targeting and four protection types (Contents, Objects, Scenarios, All). This solution is ideal for confidential data protection, template security, controlled access workflows, and automated security enforcement that require multi-level password protection with comprehensive control and seamless integration.

Setup

Add the PDF4me "Secure Excel" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites:

  • PDF4me API credentials
  • n8n workflow access

Configuration:

  1. Add PDF4me node to workflow
  2. Select "Secure Excel" action
  3. Configure input parameters (see below)
Secure Excel

Parameters

Complete list of parameters for the Secure Excel action. Configure these parameters to control protection levels and passwords.

Important: Parameters marked with an asterisk (***) are required. At least one password must be provided for respective protection level. Worksheet indexes use 0-based numbering (0 = first worksheet).

ParameterTypeDescriptionExample
Input Data Type***StringExcel Input Format Selection
• Choose the format of your Excel data input
• PDF4me supports multiple input types
• Options: Binary Data, Base64 String, or URL
Binary Data
Input Binary Field***BinaryBinary Excel File Input (Required if Binary Data)
• Reference Excel file (.xlsx, .xls) from previous n8n node or file upload
• PDF4me processes binary Excel files with automatic format detection
• Required when Input Data Type is "Binary Data"
{{ $binary.data }}
Base64 Excel Content***StringBase64 Encoded Excel Input (Required if Base64 String)
• Provide Excel content (.xlsx, .xls) as base64 encoded string
• PDF4me automatically decodes and processes the Excel content
• Required when Input Data Type is "Base64 String"
UEsDBBQABgAI...
Excel URL***StringPublic Excel URL Input (Required if URL)
• Provide a public/open permission URL to the Excel file (.xlsx, .xls)
• PDF4me downloads and processes the Excel file from the provided URL
• Required when Input Data Type is "URL"
https://abc.com/data.xlsx
Excel Name***StringExcel Input Filename
• Specify the name of the input Excel file with proper extension (.xlsx, .xls)
• PDF4me uses this for format detection and processing optimization
data.xlsx
PasswordStringFile Encryption Password (Level 1)
• Password required to open the file - encrypts entire file
Also used as fallback for workbook and worksheet protection if their specific passwords are empty
• Optional - no file encryption if empty
User Experience: Prompts "Enter password to open this file" - without password, cannot open or view file at all
• Case-sensitive
MyPassword123
Protect WorkbookBooleanEnable Workbook Structure Protection (Level 2)
• True = protect workbook structure - prevents adding/deleting/renaming/moving/hiding worksheets
• False = no structure protection (default)
• Requires password (ProtectWorkbookPassword or Password fallback)
User Experience: Prompts "This workbook is protected" when trying to modify structure
• Default: false
true
Protect Workbook PasswordStringWorkbook Protection Password (Level 2)
• Password for workbook structure protection
Password Fallback: Priority 1: ProtectWorkbookPassword (if provided), Priority 2: Password (if provided)
• Required if ProtectWorkbook = true and Password is empty
• Case-sensitive
StructurePass
Protect WorksheetsBooleanEnable Worksheet Content Protection (Level 3)
• True = protect selected worksheets - prevents data modifications
• False = no worksheet protection (default)
• Requires password (WorksheetProtectionPassword or Password fallback)
User Experience: Prompts "The cell you're trying to change is protected" when trying to edit
• Default: false
true
Worksheet Protection TypeStringType of Worksheet Protection
"Contents" = protect cell values, formulas, formatting (prevents editing cells, changing formats)
"Objects" = protect charts, images, shapes, drawings (prevents moving, resizing, deleting objects)
"Scenarios" = protect what-if analysis scenarios (prevents creating, modifying scenarios)
"All" = full protection (Contents + Objects + Scenarios) - Default, read-only access
• Case-insensitive
All
Worksheet Protection PasswordStringWorksheet Protection Password (Level 3)
• Password for worksheet content protection
Password Fallback: Priority 1: WorksheetProtectionPassword (if provided), Priority 2: Password (if provided)
• Required if ProtectWorksheets = true and Password is empty
• Case-sensitive
EditPass
Worksheet NamesStringComma-Separated Worksheet Names
• List of worksheet names to protect
• Empty = protect all worksheets
• Case-sensitive worksheet names
• Union with WorksheetIndexes
Sheet1,Summary
Worksheet IndexesStringComma-Separated Indexes (0-based)
• List of worksheet indexes to protect
• 0-based indexing (0 = first sheet)
• Empty = protect all worksheets
• Union with WorksheetNames
0,2
Binary Data Output Name***StringBinary Data Output Mapping
• Define the variable name for accessing generated Excel binary data
• Used in subsequent workflow actions
• Essential for workflow automation
document

Output

Output Parameters

ParameterTypeDescriptionExample
fileNameStringSecured Excel document filename - The name of the output password-protected Excel document fileexcel_secured.xlsx
fileSizeNumberFile size in bytes - The size of the Excel document in bytes after security application217600
successBooleanPDF4me operation status - Boolean flag indicating the success or failure of the password protection process. PDF4me returns true for successful operations and false for any errorstrue
originalFileNameStringOriginal Excel document filename - The name of the input Excel document filemyExcelFile.xlsx
fileFormatStringExcel file format - The format of the Excel file. Values: "xlsx" for Excel 2007+, "xls" for Excel 97-2003xls
filePasswordProtectedBooleanFile encryption status - Indicates whether file-level password protection (encryption) was applied. true if file encryption is enabled, false if nottrue
workbookProtectedBooleanWorkbook protection status - Indicates whether workbook structure protection was applied. true if workbook is protected, false if nottrue
worksheetsProtectedBooleanWorksheet protection status - Indicates whether worksheet content protection was applied. true if worksheets are protected, false if nottrue
worksheetProtectionTypeStringWorksheet protection type - The type of worksheet protection applied. Values: "Contents", "Objects", "Scenarios", "All"All
worksheetSelectionStringWorksheet selection - Indicates which worksheets were protected. Values: "all" if all worksheets, or specific worksheet names/indexesall
protectionSummaryArrayProtection summary - Array of strings describing the security measures applied to the document["File encryption enabled", "Workbook structure protected", "Worksheets protected (all)"]
messageStringOperation message - Descriptive message indicating the result of the security operation, including file format and all protection levels appliedSuccessfully secured Excel file (.xls): File encryption enabled, Workbook structure protected, Worksheets protected (all)

N8N Action Response

The PDF4me Secure Excel API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API:

[
{
"fileName": "excel_secured.xlsx",
"fileSize": 217600,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"fileFormat": "xls",
"filePasswordProtected": true,
"workbookProtected": true,
"worksheetsProtected": true,
"worksheetProtectionType": "All",
"worksheetSelection": "all",
"protectionSummary": [
"File encryption enabled",
"Workbook structure protected",
"Worksheets protected (all)"
],
"message": "Successfully secured Excel file (.xls): File encryption enabled, Workbook structure protected, Worksheets protected (all)"
}
]

Use Cases

Confidential Data Protection

  • Encrypt sensitive financial or personal data files with password protection
  • Protect confidential reports and documents from unauthorized access
  • Apply multi-level security to ensure data confidentiality

Template Security and Read-Only Distribution

  • Protect Excel templates from structure changes while allowing data entry
  • Distribute read-only reports with worksheet protection
  • Secure formula sheets while allowing input in designated areas

Controlled Access Workflows

  • Apply different password levels for different user groups
  • Protect specific worksheets while leaving others editable
  • Implement security policies with automated password protection

Get Help