PADExcelexcelformatwritedatatable

Write & Format Excel Range

Writes a PAD DataTable to an Excel worksheet and applies professional formatting via PowerShell: auto-fit column widths, bold header row with background colour, row borders, and optional conditional formatting for status columns (green = Complete, red = Failed, amber = Pending).

Members OnlySign in or create a free account to view and copy this pattern.

Usage Notes

  • The DataTable is first written via PAD native action, then PowerShell reopens the file to apply formatting.
  • varStartCell controls where data is written — use
  • to overwrite, or
  • to write below existing headers.
  • The conditional formatting pattern targets a column named
  • — update varStatusColumn to match your column name.
  • PowerShell COM automation requires Excel to be installed on the machine (same as PAD Excel actions).
  • Always call Excel.CloseExcel before the PowerShell step — PAD and PowerShell cannot both hold the file open.

Requirements

  • Power Automate Desktop 2.30+
  • Excel installed on the machine
  • Variables: varOutputPath (Text), varSourceData (DataTable), varSheetName (Text)