Skip to main content

Unlock Excel File and Remove Protection in n8n

Unlock File is a PDF4me Excel operation in n8n that strips password protection from an .xlsx workbook at three independent levels: file encryption, workbook structure, and worksheet protection. Use it to open protected templates, prepare files for automated data writes, or clear passwords before archiving, without opening Excel.

What this node does

PDF4me Excel: Unlock File removes Excel protection in one pass. It clears the open password (file encryption), the workbook structure lock that prevents sheets being added, deleted, or renamed, and optionally the worksheet protection that prevents cells and formulas being edited. Passwords you supply are reused as fallbacks across layers, so a workbook secured with a single password usually needs only one field filled in.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

Authenticating Your API Request

Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one holding your PDF4me API key so the workflow can authenticate unlock requests securely.

Important Facts You Should Not Miss

Three protection levels, one operation
File encryption, workbook structure, and worksheet protection are independent locks in Excel. A workbook can carry any combination, and this operation addresses all three in a single run.
Passwords fall back across layers
Each layer is first tried with no password. Where a password is supplied it is also reused against the other layers, so one password in File Encryption Password often clears a workbook secured the same way throughout.
Worksheet unlocking is opt-in
The Unlock Worksheets toggle is off by default. Leave it off to clear only the open password and structure lock; switch it on when cells and formulas must also become editable.
PDF4me Excel node in n8n set to Operation Unlock File, Excel File Input Method From Previous Node (Binary Data), Binary Data Property Name data, File Encryption Password and Workbook Protection Password fields empty, Unlock Worksheets toggle off, Culture Name en-US, Output File Name excel_unlocked.xlsx, Source Document Name myExcelFile.xlsx, Output Binary Data Name data

PDF4me Excel Unlock File parameters panel in n8n

Which Excel Protection Does Each Field Remove?

Excel applies protection at three separate levels, and they are easy to confuse. This table maps each one to what it blocks and which field clears it.

Protection levelWhat it blocksField that clears it
File encryptionThe workbook cannot be opened at all without a password. Excel prompts before any content is visible.File Encryption Password
Workbook structureSheets cannot be added, deleted, renamed, moved, hidden, or unhidden, though existing cells stay editable.Workbook Protection Password
Worksheet protectionCells, formulas, and objects on a sheet cannot be edited, though the file opens and the structure is intact.Unlock Worksheets toggle

What Parameters Does Unlock File Need?

Required: Operation, Excel File Input Method, the input field matching that method, and Output File Name. The password fields are conditional, needed only for the protection levels actually present on the workbook. Unlock Worksheets, Culture Name, Source Document Name, and Output Binary Data Name are optional.

ParameterRequiredWhat it doesExample
OperationRequiredSelects the PDF4me Excel action to run. Choose Unlock File.Unlock File
Excel File Input MethodRequiredHow the workbook reaches the node. From Previous Node (Binary Data) reads it from an upstream item; the dropdown also offers base64 and file URL alternatives.From Previous Node (Binary Data)
Binary Data Property NameConditionalName of the binary property on the incoming n8n item holding the .xlsx workbook. Applies when the input method is binary data. Defaults to data.data
File Encryption PasswordConditionalThe password required to open the workbook. Supply it when the file is encrypted; it is also reused as a fallback against the other protection levels.FilePass123
Workbook Protection PasswordConditionalThe password guarding workbook structure, which prevents sheets being added, deleted, renamed, or moved. Supply it when structure protection is set.StructurePass
Unlock WorksheetsOptionalToggle that extends the run to worksheet-level protection so cells, formulas, and objects become editable. Off by default.true
Culture NameOptionalLocale used while processing the workbook, relevant for locale-sensitive number and date formatting.en-US
Output File NameRequiredFilename for the unlocked workbook the node returns. Include the .xlsx extension.excel_unlocked.xlsx
Source Document NameOptionalReference label for the incoming workbook. Echoed back as originalFileName for tracking; it does not change the output.myExcelFile.xlsx
Output Binary Data NameOptionalName of the binary property the output item exposes. Defaults to data.data

Output Fields

A successful run returns one n8n item carrying JSON metadata plus the unlocked workbook as binary data.

FieldTypeWhat it contains
successBooleanTrue when protection was removed successfully. Use it to route error-handling branches.
fileNameStringFilename of the unlocked workbook, matching Output File Name.
fileSizeNumberSize of the returned workbook in bytes.
originalFileNameStringThe value supplied in Source Document Name, echoed back for tracking.
messageStringHuman-readable result message for the unlock operation.
Binary (data)BinaryThe unlocked .xlsx under Output Binary Data Name (default data). Pass into Write Binary File, Email, or a cloud-storage upload.

N8N Action Response

JSON Response Format

[
{
"fileName": "excel_unlocked.xlsx",
"fileSize": 14234,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"message": "Excel document unlocked successfully"
}
]

How Do I Set Up Unlock File in n8n?

  1. Add the PDF4me Excel node to your workflow and set Operation to Unlock File.
  2. In Credential to connect with, select your PDF4me API credential or create one with your API key.
  3. Set Excel File Input Method to From Previous Node (Binary Data) and set Binary Data Property Name to the property holding the workbook, normally data.
  4. Enter File Encryption Password if the workbook requires a password to open.
  5. Enter Workbook Protection Password if the sheet structure is locked.
  6. Switch on Unlock Worksheets if cells and formulas also need to become editable.
  7. Optionally set Culture Name for locale-sensitive workbooks.
  8. Set Output File Name ending in .xlsx, execute the node, and route the unlocked workbook onward.

Typical Setups

Workflow ExamplesCommon n8n workflow patterns using Unlock File for Excel.
Unlock a protected template before writing data
  1. A workflow pulls a locked reporting template from SharePoint.
  2. Unlock File clears the structure lock so new sheets can be added.
  3. PDF4me Excel Add Rows writes the period figures into the workbook.
Clear passwords before archiving
  1. A Schedule Trigger collects workbooks due for long-term storage.
  2. Unlock File removes the open password so the archive stays readable later.
  3. The cleared files are written to the archive bucket.
Make a supplier workbook machine-readable
  1. An email trigger receives a protected price list from a supplier.
  2. Unlock File runs with Unlock Worksheets on so cell values can be parsed.
  3. The rows are extracted and synced into an internal database.
Unlock, edit, then re-secure
  1. Unlock File removes protection from an approved workbook.
  2. Downstream nodes update figures and refresh a summary sheet.
  3. PDF4me Excel Secure Excel reapplies a password before redistribution.

Practical Tips

Try it with no password first
Structure and worksheet protection are often set without any password. Run the node with the password fields empty before assuming you need one.
One password usually covers all layers
Because supplied passwords are reused as fallbacks, filling in File Encryption Password alone often clears a workbook secured the same way throughout.
Passwords are case-sensitive
A mismatch in capitalisation fails the layer silently rather than erroring loudly, so check case before debugging further.
Leave Unlock Worksheets off unless needed
Removing cell-level protection can expose formulas that were deliberately locked. Enable it only when downstream nodes must edit cells.
Re-secure after editing
Unlocking is usually a middle step. Chain Secure Excel at the end so the redistributed workbook is protected again.
Output File Name needs the .xlsx extension
Omitting it can leave downstream nodes unable to detect the format when writing or emailing the file.

Cheat Sheet

FieldValue
OperationUnlock File
Excel File Input MethodFrom Previous Node (Binary Data)
Binary Data Property Namedata
File Encryption Password(only if the file needs a password to open)
Workbook Protection Password(only if the sheet structure is locked)
Unlock Worksheetsoff (on to make cells editable)
Culture Nameen-US
Output File Nameexcel_unlocked.xlsx
Source Document NamemyExcelFile.xlsx
Output Binary Data Namedata
CredentialsPDF4me API credential

Common Questions

What are the three levels of Excel protection this removes?+
File encryption is the password required to open the file at all. Workbook structure protection stops sheets being added, deleted, renamed, or moved. Worksheet protection stops cells, formulas, and objects being edited. Each level is independent, as described in Microsoft protection and security in Excel.
Do I need to supply a password for every protection level?+
No. Only supply the passwords that apply. The operation first attempts to remove each layer with no password, and where a password is supplied it is also reused as a fallback for the other layers, so a workbook that uses one password throughout usually needs only File Encryption Password filled in.
What does the Unlock Worksheets toggle do?+
It controls whether worksheet-level protection is cleared as part of the run. Leave it off to remove only file encryption and workbook structure protection. Switch it on when cells, formulas, or objects also need to become editable.
Is this the same as cracking an unknown Excel password?+
No. The operation removes protection you are authorised to remove, using passwords you supply or protection that carries no password. It is intended for automating access to your own files, such as unlocking a protected template before a workflow writes data into it.
What is Culture Name for?+
Culture Name sets the locale used while the workbook is processed, for example en-US or de-DE. It matters when a workbook contains locale-sensitive formatting such as decimal separators or date formats. Leaving it at the default uses the standard culture.
What is the difference between Output File Name and Source Document Name?+
Output File Name is the filename of the unlocked workbook the node returns. Source Document Name is a reference label echoed back as originalFileName in the response, useful for tracking. Both can be driven by expressions, following the n8n expressions documentation.

Same Task on Other Platforms

Get Help