Skip to main content

Unlock Excel Files in Power Automate

PDF4me Unlock Excel is a Power Automate action that removes password protection from a workbook at up to three independent layers, file encryption, workbook structure, and worksheet content. Use it to open, edit, or re-protect Excel files without manually entering passwords in the desktop app.

What this action does

PDF4me Unlock Excel takes File Password, Workbook Password, and Worksheet Password as independent inputs and removes only the protection layers that are actually present on the file. Fill in only the passwords you know, worksheet targeting and culture are both optional advanced parameters.

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

How Do I Authenticate My Power Automate Flow?

Every PDF4me action in Power Automate requires a valid connection. Create or select one that holds your PDF4me API key so the flow can authenticate Excel unlock requests securely.

Important Facts You Should Not Miss

Three independent password layers
File Password removes open-file encryption, Workbook Password removes structure protection, Worksheet Password removes sheet-level content protection. Provide only the ones the file actually uses.
Worksheet targeting is 1-based
Advanced parameters shows "Showing 3 of 3": Worksheet Names, Worksheet Indexes (1-based, so 1 = first sheet), and Culture Name. Leave the worksheet fields empty to unlock every sheet.
A wrong password fails the whole run
If any provided password does not match its layer, Success returns false with an ErrorMessage naming which layer failed. No partial unlock is returned.
Power Automate PDF4me Excel Unlock File action configured with File Content mapped from Secured File Content, File Name test.xlsx, File Password 56789, Workbook Password 12345, Worksheet Password 34567, and Advanced parameters showing 3 of 3 with Worksheet Names, Worksheet Indexes, and Culture Name fields

Map File Content, set File Name, then fill only the File Password, Workbook Password, or Worksheet Password layers the file actually uses.

Parameters

Required: File Content must always be provided. File Name and all three password fields are optional, only the passwords matching the file's actual protection layers are needed. Worksheet Names, Worksheet Indexes, and Culture Name are conditional advanced parameters.

ParameterRequiredWhat it doesExample
File ContentRequiredBase64 content of the source Excel workbook, mapped from SharePoint, OneDrive, or another prior action.[File Content from Get file content]
File NameOptionalExcel filename including extension (.xlsx or .xls), used for processing and output identification.test.xlsx
File PasswordConditionalRemoves the encryption password required to open the file. Only needed if the file is open-password protected.56789
Workbook PasswordConditionalRemoves workbook structure protection that blocks adding, deleting, or renaming sheets. Only needed if the workbook is structure-protected.12345
Worksheet PasswordConditionalRemoves worksheet-level protection that blocks editing cells or objects on a sheet. Only needed if the worksheet is protected.34567
Worksheet NamesConditionalAdvanced parameter. Comma-separated worksheet names to unlock. Leave empty along with Worksheet Indexes to unlock every sheet.Sheet1,Summary
Worksheet IndexesConditionalAdvanced parameter. Comma-separated 1-based worksheet indexes to unlock (1 = first sheet). Combines with Worksheet Names if both are set.1,2,3
Culture NameConditionalAdvanced parameter. Culture/locale code for processing, for example en-US or de-DE. Blank uses the default culture.en-US

Output Fields

FieldTypeWhat it contains
documentBase64The Excel workbook with the requested protection layers removed.
SuccessBooleantrue if the action completed, false if it failed.
ErrorMessageStringError description naming the failed password layer, null when Success is true.
ErrorsArrayDetailed error objects, empty when Success is true.

What Do the Common Error Messages Mean?

Error MessageCauseSolution
Request is emptyThe request object is null.Provide a valid request object.
Document is emptyFile Content is null or empty.Provide a valid Excel document in File Content.
The workbook is password-protected. Please provide File Password to open the file.The file is encrypted but no File Password was provided.Provide the correct File Password.
Could not open the workbook with File Password: incorrect passwordThe provided File Password does not match.Verify and provide the correct File Password.
Workbook is protected. Please provide Workbook Password.The workbook has structure protection but no valid password.Provide the correct Workbook Password.
Worksheet '{name}' is protected. Please provide a valid password.The named worksheet has content protection but no valid password.Provide the correct Worksheet Password.
Invalid worksheet selectionA worksheet name or index does not exist in the workbook.Use existing worksheet names or valid 1-based indexes.
Available worksheets in workbook (X total)Informational message shown when worksheet selection fails.Use worksheet indexes from 1 to X.

How Do I Set Up Unlock Excel in Power Automate?

  1. Add PDF4meExcel - Unlock File to your Power Automate flow.
  2. Map File Content from a previous action (SharePoint, OneDrive, or Get file content) and set File Name.
  3. Fill File Password if the file requires a password to open.
  4. Fill Workbook Password if sheet add/delete/rename is blocked, and Worksheet Password if cell editing is blocked on a specific sheet.
  5. Expand Advanced parameters to target specific Worksheet Names or Worksheet Indexes (1-based), or leave both empty to unlock every sheet. Run the flow, the unlocked workbook returns as document.

Typical Setups

Workflow ExamplesCommon Power Automate flow patterns using Unlock Excel.
Protected template update cycle
  1. A scheduled trigger runs at the start of each quarterly template update cycle.
  2. Get file content retrieves a password-protected Excel template from the library.
  3. Unlock Excel removes protection using the known File Password and Workbook Password.
  4. An Update Rows or similar action modifies the unlocked template, then Secure Excel re-applies protection before it is redistributed.
Protected data sync
  1. A scheduled nightly flow retrieves the password-protected master data workbook.
  2. Unlock Excel removes the File Password protecting the workbook.
  3. Update Rows and Add Rows refresh the data from a connected database.
  4. Secure Excel re-applies the same password before the file is saved back to SharePoint.
Selective worksheet access
  1. A flow triggers when a manager requests edit access to specific worksheets.
  2. Get file content retrieves a workbook with several independently protected worksheets.
  3. Unlock Excel targets only the requested sheets via Worksheet Names, using Worksheet Password to remove content protection while other sheets stay locked.
  4. The partially unlocked file is emailed to the requesting manager.

Practical Tips

Only fill the passwords you need
File Password, Workbook Password, and Worksheet Password are all independent and optional. A file protected only at the worksheet level needs just Worksheet Password.
Worksheet indexes are 1-based here
Unlike some other PDF4me Excel actions that use 0-based indexes, Worksheet Indexes on this action starts at 1 for the first sheet. Double-check which convention the connected action expects.
A wrong password fails the whole run
There is no partial unlock. If any password you supplied does not match its layer, Success returns false and no document is produced.
Re-lock with Secure Excel after editing
If the workflow needs to preserve protection, pair this action with Secure Excel at the end of the flow to reapply passwords after edits are complete.
Store passwords in a secure vault, not the flow
Reference File Password, Workbook Password, and Worksheet Password from Azure Key Vault or a secure connector variable rather than hardcoding them in the flow definition.

Cheat Sheet

FieldValue
ActionExcel - Unlock File
Required fieldsFile Content
Password layersFile Password, Workbook Password, Worksheet Password (each optional/conditional)
Advanced parameters3 total: Worksheet Names, Worksheet Indexes (1-based), Culture Name
Outputdocument (Base64 workbook) + Success + ErrorMessage + Errors

Common Questions

How do I unlock an Excel file in Power Automate?+
Add the PDF4me Unlock File action, map the workbook into File Content, and provide whichever of File Password, Workbook Password, or Worksheet Password matches the protection on that file. Leave a field blank if that layer is not protected.
What is the difference between File Password, Workbook Password, and Worksheet Password?+
File Password removes the encryption that requires a password just to open the file. Workbook Password removes protection that blocks adding, deleting, or renaming sheets. Worksheet Password removes protection that blocks editing cells or objects on a specific sheet. See Microsoft's <a href="https://support.microsoft.com/en-us/office/protect-a-workbook-02f2d3c1-3bc5-4c1a-a5c2-6b3c6a8d8d3f" target="_blank" rel="noopener noreferrer">guide to workbook and worksheet protection</a> for how these layers work natively in Excel.
Can I unlock only specific worksheets instead of the whole workbook?+
Yes. Expand Advanced parameters and list Worksheet Names or Worksheet Indexes, using 1-based numbering. Leaving both empty unlocks every worksheet in the workbook.
What happens if I provide the wrong password?+
The action fails and returns Success false with an ErrorMessage naming which password layer could not be validated, for example an incorrect File Password or Workbook Password.
Do I need to know all three passwords to unlock a file?+
No. Provide only the passwords for the protection layers that are actually present. A file with only worksheet protection needs just Worksheet Password. See a community discussion on <a href="https://www.reddit.com/r/excel/comments/mniaxc/unlock_any_excel_sheet_without_knowing_the/" target="_blank" rel="noopener noreferrer">unlocking an Excel sheet without knowing the password</a> for why protection layers are independent.

Industry Use Cases & Applications

  • Period Close: Unlock financial reports for final adjustments before close
  • Template Updates: Remove protection from accounting templates for updates
  • Audit Preparation: Unlock files for auditor access and review
  • Data Integration: Unlock protected files for automated data synchronization

Same Task on Other Platforms

Get Help