# Create an Excel workbook

Create an Excel workbook on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice)

Stars**743**

Forks**87**

Open issues**6**

PowerShell Gallery downloads**5437281**

Release**v3.6.2**

Language: C# Updated: 2026-11-27

Curated Examples

Use PSWriteOffice to create an Excel workbook with a summary table.

This pattern is useful when a PowerShell script should produce a workbook instead of only console output.

It is adapted from `Examples/Excel/Example-ExcelBasic.ps1`.

## Example

```powershell
Import-Module PSWriteOffice

$outputPath = Join-Path $PSScriptRoot 'Output\RevenueSnapshot.xlsx'
$null = New-Item -ItemType Directory -Path (Split-Path $outputPath) -Force
$data = @(
    [PSCustomObject]@{ Region = 'North America'; Revenue = 125000; YoY = 0.12 }
    [PSCustomObject]@{ Region = 'EMEA'; Revenue = 98000; YoY = 0.22 }
    [PSCustomObject]@{ Region = 'APAC'; Revenue = 143000; YoY = 0.18 }
)

New-OfficeExcel -Path $outputPath {
    Add-OfficeExcelSheet -Name 'Summary' -Content {
        Set-OfficeExcelRow -Row 1 -Values 'Region', 'Revenue', 'YoY'
        Add-OfficeExcelTable -Data $data -TableName 'Sales' -TableStyle 'TableStyleMedium9'
        Set-OfficeExcelColumn -Column 1 -AutoFit
    }
}
```

## What this demonstrates

- creating an Excel workbook without automating desktop Excel
- writing a named worksheet and table
- keeping generated files under a local output folder

## Source

- [Example-ExcelBasic.ps1](https://github.com/EvotecIT/PSWriteOffice/blob/main/Examples/Excel/Example-ExcelBasic.ps1)

<!-- PowerForge markdown artifact sha256:AB01A2E5EE84F1DE282AA2E7963E12E5F603534C47F855186AE537EFBB5081BE -->
