Skip to main content

Add Text Header Footer to Excel in Power Automate

PDF4me Add Text Header Footer to Excel is a Power Automate action that stamps custom text into the six header and footer zones of a workbook, Left, Center, and Right on both the header and the footer. Use it to brand reports with a title, mark a footer confidential, or stamp a generation date without opening Excel manually.

What this action does

PDF4me Add Text Header Footer to Excel writes text into any of six independent zones, Header Left, Header Center, Header Right, Footer Left, Footer Center, and Footer Right, on an existing workbook. Leave a zone blank to skip it. Advanced parameters expose per-zone styling such as text color, which only applies once the matching zone has text.

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 header/footer requests securely.

Important Facts You Should Not Miss

Six independent zones, not one watermark field
Header Left Text, Header Center Text, Header Right Text, Footer Left Text, Footer Center Text, and Footer Right Text are each optional. Fill only the zones you need, an empty zone stays untouched.
Advanced parameters style specific zones
The confirmed example is Header Left - Color. The panel lists 15 advanced parameters in total for per-zone formatting, and a style setting only renders once its matching Text zone has a value.
Only File Content and File Name are mandatory
Every header/footer text zone and every advanced style parameter is optional. An action with all six zones left blank still runs successfully, it just returns the workbook unchanged.
Power Automate PDF4me Add Text Header Footer action configured with File Content, File Name add_header_sample_file.xlsx, Header Left Text Pdf4me Test, empty Header Center and Right Text, empty Footer Left, Center, and Right Text, and Advanced parameters showing Header Left - Color set to Black

Map File Content and File Name, fill any header/footer text zones you need, then expand Advanced parameters for per-zone styling.

Parameters

Required: File Content and File Name must always be provided. All six header/footer text zones are optional, fill only the ones you need. Advanced style parameters are conditional, they take effect only when their matching text zone has a value.

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 NameRequiredExcel filename including extension (.xlsx or .xls), used for processing and output identification.add_header_sample_file.xlsx
Header Left TextOptionalText placed in the left section of the header. Leave blank to skip this zone.Pdf4me Test
Header Center TextOptionalText placed in the center section of the header.Confidential Report
Header Right TextOptionalText placed in the right section of the header.Page 1
Footer Left TextOptionalText placed in the left section of the footer.Internal Use Only
Footer Center TextOptionalText placed in the center section of the footer.Generated 2026-07-06
Footer Right TextOptionalText placed in the right section of the footer.Confidential
Header Left - ColorConditionalFont color for the Header Left Text zone, hex or color name. Only takes effect if Header Left Text has a value. One of 15 advanced parameters in the connector panel, expand Advanced parameters in the designer for the remaining per-zone style controls.Black

Output Fields

FieldTypeWhat it contains
documentBase64The Excel workbook with the configured header/footer text applied.
SuccessBooleantrue if the action completed, false if it failed.
ErrorMessageStringError description, 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.Map a valid Excel document into File Content.
Invalid file formatThe mapped file is not a valid Excel document.Confirm the source file is a genuine .xlsx or .xls workbook.
Invalid color formatA color parameter has an invalid hex code or color name.Use a valid hex format such as #FF0000 or a standard color name.
  1. Add PDF4meExcel - Add Text Header Footer to your Power Automate flow.
  2. Map File Content and File Name from a previous action (SharePoint, OneDrive, or Get file content).
  3. Fill any of Header Left Text, Header Center Text, or Header Right Text for the header zones you need.
  4. Fill any of Footer Left Text, Footer Center Text, or Footer Right Text for the footer zones you need.
  5. Expand Advanced parameters to style a filled zone, for example Header Left - Color. Run the flow, the branded workbook returns as document.

Typical Setups

Workflow ExamplesCommon Power Automate flow patterns using Add Text Header Footer.
Monthly report title stamping
  1. A scheduled trigger runs on the monthly report generation date.
  2. Get file content retrieves the finished report workbook from SharePoint.
  3. Add Text Header Footer sets Header Center Text to the report title and Footer Left Text to a generated-on note.
  4. The branded workbook is uploaded back to the reports document library.
Confidentiality marking
  1. An instant flow runs when a sensitive Excel file is uploaded to a restricted folder.
  2. Get file content retrieves the workbook from that folder.
  3. Add Text Header Footer sets Footer Center Text to a confidentiality notice.
  4. The marked workbook is saved back to the same restricted library.
Client deliverable branding
  1. A flow triggers when a deliverable is marked Final in a project management connector.
  2. Get file content retrieves the final Excel deliverable.
  3. Add Text Header Footer sets Header Left Text to the company name and Footer Right Text to a formatDateTime expression.
  4. The branded file is emailed to the client stakeholder.

Practical Tips

Leave a zone blank to skip it
You do not need to fill all six text zones. An empty Header Right Text or Footer Left Text simply leaves that section unchanged.
Styling only applies to filled zones
Setting Header Left - Color has no visible effect unless Header Left Text also has a value. Fill the text first, then style it.
File Name needs the extension
Always include .xlsx or .xls in File Name. Omitting the extension can prevent the output from opening correctly in Excel.
Use expressions for auto-updating footers
Map Power Automate's formatDateTime() expression into a footer Text field for a footer that always shows the current date without manual edits.
Branch on Success before continuing
Add a Condition on Success after this action so a failed run does not pass an unbranded or unchanged workbook further down the flow.

Cheat Sheet

FieldValue
ActionExcel - Add Text Header Footer
Required fieldsFile Content, File Name
Header zonesHeader Left Text, Header Center Text, Header Right Text (each optional)
Footer zonesFooter Left Text, Footer Center Text, Footer Right Text (each optional)
Advanced parameters15 total, confirmed example Header Left - Color (conditional on matching text zone)
Outputdocument (Base64 workbook) + Success + ErrorMessage + Errors

Common Questions

How do I add a header and footer to Excel files in Power Automate?+
Add the PDF4me Add Text Header Footer action, map the workbook into File Content, set a File Name, then fill in any of the six Header Left, Header Center, Header Right, Footer Left, Footer Center, or Footer Right Text fields you need. Leave the rest blank.
Can I add page numbers to an Excel header with this action?+
The header and footer text fields accept literal text only, not Excel's built-in page-number field codes. To show a running page count, generate the number upstream in your flow and map it into one of the Text fields as a plain string. See Microsoft's guide to <a href="https://support.microsoft.com/en-us/office/headers-and-footers-in-a-worksheet" target="_blank" rel="noopener noreferrer">headers and footers in a worksheet</a> for how native Excel page-number codes work if you are building the sheet manually.
How do I set the header text color?+
Expand Advanced parameters in the action panel. The connector exposes 15 advanced style parameters, one confirmed example is Header Left - Color, which only takes effect once Header Left Text has a value.
Does this action support both .xls and .xlsx files?+
Yes. Map either format into File Content and keep the File Name extension consistent with the source workbook. See <a href="https://www.ablebits.com/office-addins-blog/excel-header-footer-add-change-remove/" target="_blank" rel="noopener noreferrer">Ablebits' guide to Excel headers and footers</a> for how the underlying Excel formatting behaves across file formats.
What happens if I leave every header and footer field blank?+
The action still runs and returns Success true, but the workbook is unchanged since there is no text to place in any zone.

Industry Use Cases & Applications

  • Financial Statements: Add headers with company name and reporting period
  • Budget Reports: Insert confidentiality footers on budget documents
  • Audit Documents: Apply audit date and version information in headers
  • Expense Reports: Add submission date and approval status in footers

Same Task on Other Platforms

Get Help