Skip to main content

Secure Excel in Power Automate

PDF4me Secure Excel action applies comprehensive password protection to Excel documents in Power Automate with multi-level security control. This powerful security feature supports three independent protection 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), perfect for confidential data protection, template security, and controlled access workflows across Microsoft 365.

Authenticating Your API Request

To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user, enabling seamless integration between your Power Automate flows and PDF4me's powerful Excel security services.

Secure Excel Power Automate

Key Features

  • Three Protection Levels: File encryption, workbook structure, worksheet content
  • Independent Passwords: Use different passwords for each protection level
  • Password Fallback: Automatically use main password if level-specific password not provided
  • Flexible Worksheet Selection: Protect specific worksheets or all worksheets
  • Protection Type Options: Contents, Objects, Scenarios, or All (comprehensive)
  • 0-Based Indexing: Worksheet indexes use standard 0-based numbering

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
File Content***Base64Source Excel File Content
• Map Excel file from previous action output
• Supports Excel files from SharePoint, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• Must be valid Excel document (.xlsx, .xls formats)
[File Content from Get File]
File Name***StringExcel Document Name
• Specify Excel file name with extension (.xlsx, .xls)
• Used for processing and output file naming
• Must include proper file extension
• Supports dynamic naming from flow variables
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

Output

The PDF4me Secure Excel action returns comprehensive output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
documentBase64Password-protected Excel document
SuccessBooleantrue if operation successful, false if failed
Error MessageStringError description (null if successful)
ErrorsArrayList of detailed error information (empty array if successful)

Common Error Messages

Understanding and troubleshooting errors helps ensure smooth Excel security workflows:

Error MessageCauseSolution
"Request is empty"Request object is nullProvide valid request object
"Document is empty"Document object is nullProvide valid Excel document
"Password is required for workbook protection. Please provide either a main password or workbook protection password."ProtectWorkbook = true but both passwords emptyProvide Password or ProtectWorkbookPassword
"Password is required for worksheet protection on '{worksheetName}'. Please provide either a main password or worksheet protection password."ProtectWorksheets = true but both passwords emptyProvide Password or WorksheetProtectionPassword
"Invalid worksheet selection"Worksheet name doesn't exist or index out of rangeUse valid worksheet names or indexes (0-based)
"Available worksheets in workbook (X total)"Informational message when worksheet validation failsUse valid values from X available worksheets
"Error securing Excel file: {message}"Generic processing errorCheck file integrity and parameter values

Workflow Examples

The PDF4me Secure Excel action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated Confidential Report Protection Workflow

Transform your sensitive data distribution with multi-level password protection:

Complete Workflow Steps:

  1. Trigger: Monthly financial report generation completed
  2. Get Financial Report: Retrieve Excel report from SharePoint
  3. Apply File Encryption: Set Password = "Finance2024!" for file opening
  4. Protect Structure: Set ProtectWorkbook = true, ProtectWorkbookPassword = "Structure456"
  5. Protect Worksheets: Set ProtectWorksheets = true, WorksheetProtectionPassword = "Edit789"
  6. Set Full Protection: WorksheetProtectionType = "All"
  7. Apply to All Sheets: Leave WorksheetNames and WorksheetIndexes empty
  8. Email CFO: Send protected file to CFO with passwords via separate secure channel
  9. Archive Protected: Store encrypted version in finance vault

Business Benefits:

  • Secures 12 financial reports annually with three-tier protection
  • Prevents unauthorized access with file encryption
  • Ensures report integrity with structure and content protection
  • Complies with SOX and financial data security requirements

Industry Use Cases & Applications

Finance & Accounting Use Cases

  • Financial Statements: Encrypt quarterly reports with multi-level protection
  • Budget Templates: Protect template structure and formula sheets
  • Audit Documents: Apply read-only protection to audit deliverables
  • Payroll Files: Encrypt salary data with full protection

Get Help