跳到主要内容

解锁 Excel 文件和移除保护 n8n

解锁文件 是一个 PDF4me Excel 操作 n8n 它能从三个独立层面解除 .xlsx 工作簿的密码保护:文件加密、工作簿结构和工作表保护。您可以使用它打开受保护的模板、准备用于自动数据写入的文件,或在归档前清除密码,而无需打开文件。 Excel

此节点的功能

PDF4me Excel解锁文件 移除 Excel 一次操作即可完成保护。它会清除打开密码(文件加密)、工作簿结构锁(防止添加、删除或重命名工作表),还可以选择性地清除工作表保护(防止编辑单元格和公式)。您提供的密码会在各个层级重复使用作为备用密码,因此,使用单个密码保护的工作簿通常只需填写一个字段即可。

相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客

验证您的身份 API 要求

每一个 PDF4me 节点 n8n 需要有效 用于连接的凭证创建或选择一个包含您的 PDF4me API 关键在于确保工作流程能够安全地验证解锁请求。

您不容错过的重要事实

三级防护,一次操作
文件加密、工作簿结构和工作表保护是各自独立的安全机制。 Excel一个工作簿可以包含任意组合,此操作一次运行即可处理所有三种组合。
密码回退层
首先,系统会尝试不使用密码对每一层进行加密。如果提供了密码,则该密码也会用于其他层,因此,文件加密密码中的一个密码往往会清除整个加密方式相同的加密工作簿。
工作表解锁是可选的。
“解锁工作表”开关默认处于关闭状态。保持关闭状态仅清除打开密码和结构锁定;当需要同时解锁单元格和公式时,请打开此开关。
PDF4me Excel 节点在 n8n 中设置为“操作:解锁文件”,Excel 文件输入方法为“来自上一个节点(二进制数据)”,二进制数据属性名称为“data”,文件加密密码和工作簿保护密码字段为空,解锁工作表开关关闭,区域性名称为“en-US”,输出文件名为“excel_unlocked.xlsx”,源文档名称为“myExcelFile.xlsx”,输出二进制数据名称为“data”。

PDF4me Excel 在“解锁文件参数面板”中 n8n

哪个 Excel 每个字段移除哪些保护措施?

Excel 它提供三级保护,这三级保护很容易混淆。下表列出了每级保护的具体内容以及清除该保护的字段。

保护级别它阻挡了什么清除它的字段
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

解锁文件需要哪些参数?

必需的: 手术, Excel 文件输入方法、与该方法匹配的输入字段以及输出文件名。密码字段是条件性的,仅当工作簿中存在特定保护级别时才需要。解锁工作表、区域性名称、源文档名称和输出二进制数据名称是可选的。

范围必需的它的作用例子
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

输出字段

一次成功的运行返回一个 n8n 携带物品 JSON 元数据以及已解锁的工作簿(以二进制数据形式)。

场地类型它包含什么
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 行动反应

JSON 回复格式

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

如何在[此处应填写具体内容,例如“如何设置解锁文件”]中设置解锁文件 n8n

  1. 添加 PDF4me Excel 将节点添加到您的工作流程并设置 手术解锁文件
  2. 用于连接的凭证请选择您的 PDF4me API 或使用您的凭证创建一个凭证 API 钥匙。
  3. Excel 文件输入法来自上一个节点(二进制数据) 并设置 二进制数据属性名称 通常情况下,归还给存放工作簿的财产。 data
  4. 进入 文件加密密码 如果工作簿需要密码才能打开。
  5. 进入 工作簿保护密码 如果图纸结构被锁定。
  6. 打开 解锁工作表 如果单元格和公式也需要变为可编辑状态。
  7. (可选) 文化名称 适用于对区域设置敏感的工作簿。
  8. 输出文件名 以……结尾 .xlsx执行该节点,并将已解锁的工作簿路由下去。

典型配置

工作流程示例Common n8n workflow patterns using Unlock File for Excel.
写入数据前,请先解锁受保护的模板。
  1. 工作流从……中提取已锁定的报告模板 SharePoint
  2. 解锁文件会清除结构锁定,以便添加新的工作表。
  3. PDF4me Excel “添加行”操作会将期间数据写入工作簿。
归档前请清除密码
  1. 计划触发器会收集需要长期存储的工作簿。
  2. 解锁文件会移除打开密码,以便稍后可以读取存档文件。
  3. 已清除的文件将写入归档存储桶。
Make 供应商工作簿(机器可读)
  1. 邮件触发器会从供应商处接收受保护的价格清单。
  2. “解锁文件”功能与“解锁工作表”功能同时运行,以便解析单元格值。
  3. 提取数据行并同步到内部数据库。
解锁、编辑,然后重新锁定
  1. 解锁文件会移除已批准工作簿的保护。
  2. 下游节点更新数据并刷新汇总表。
  3. PDF4me Excel 安全的 Excel 重新分发前重新应用密码。

实用技巧

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.

速查表

场地价值
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

常见问题

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.

相关操作

在其他平台上执行相同任务

获取帮助