# New-OfficeExcel

Creates a new Excel workbook using the DSL. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

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/0.2.0)

Stars **725**

Forks **84**

Open issues **4**

Total downloads **5,250,223**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelNew, OfficeExcel

**Module**

`PSWriteOffice`

**Aliases**

`ExcelNew` `OfficeExcel`

**Inputs**

`None`

**Source**

[NewOfficeExcelCommand.cs:30](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/NewOfficeExcelCommand.cs#L30) 

Creates a new Excel workbook using the DSL.

## Syntax

```
New-OfficeExcel
[-ApplicationName <String>]
[-Author <String>]
[-Category <String>]
[-ClearCachedFormulaResults]
[-Company <String>]
[[-Content] <ScriptBlock>]
[-DateSystem <1900|1904|NineteenHundred|NineteenFour>]
[-Description <String>]
[-DisableFastPackageWriter]
[-DocumentTitle <String>]
[-EvaluateFormulas]
[-ForceFullCalculationOnOpen]
[-Keywords <String>]
[-LastModifiedBy <String>]
[-Manager <String>]
[-MarkFormulasDirty]
[-NoSave]
[-Open]
[-PassThru]
[-Password <String>]
[-Path] <String>
[-SafePreflight]
[-SafeRepairDefinedNames]
[-Subject <String>]
[-TemplatePath <String>]
[-ValidateOpenXml]
[<CommonParameters>]
```

[#](#member-418a3eaa7f98f11bc8cf22f9)

Parameter set: `All Parameter Sets`

## Description

Runs the provided script block inside an ExcelSheet/ExcelCell DSL context and saves the file.

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Create an Excel workbook](/projects/pswriteoffice/examples/create-excel-workbook/) Example
  
  A curated example for creating an Excel workbook and table output.

## Examples

### Create a workbook with a sheet and a few cells.

```powershell
New-OfficeExcel -Path .\report.xlsx { ExcelSheet 'Data' { ExcelCell -Address 'A1' -Value 'Region' } }
```

Creates report.xlsx and writes “Region” into cell A1 on the Data worksheet.

### Keep a workbook for incremental composition.

```powershell
$workbook = New-OfficeExcel -Path .\report.xlsx -NoSave
$sheet = $workbook | Add-OfficeExcelSheet -Name 'Data' -PassThru
$sheet | Set-OfficeExcelCell -Address A1 -Value 'Region'
$workbook | Save-OfficeExcel
$workbook | Close-OfficeExcel
```

Associates the output path with a live workbook, changes a worksheet, then saves and closes it once.

## Parameters

**-ApplicationName String optional**

Workbook application-name metadata.

**-Author String optional**

Workbook author metadata.

**-Category String optional**

Workbook category metadata.

**-ClearCachedFormulaResults SwitchParameter optional**

Remove cached formula results before saving.

**-Company String optional**

Workbook company metadata.

**-Content ScriptBlock optionalposition: 1**

DSL scriptblock describing workbook content.

**-DateSystem String optional**

Workbook date system for Excel date serials.

Possible values: `1900`, `1904`, `NineteenHundred`, `NineteenFour`

**-Description String optional**

Workbook description metadata.

**-DisableFastPackageWriter SwitchParameter optional**

Disable OfficeIMO fast package writers for this save.

**-DocumentTitle String optional**

Workbook document title metadata.

**-EvaluateFormulas SwitchParameter optional**

Evaluate supported formulas and write cached values before saving.

**-ForceFullCalculationOnOpen SwitchParameter optional**

Request a full workbook recalculation when opened in Excel-compatible applications.

**-Keywords String optional**

Workbook keyword metadata.

**-LastModifiedBy String optional**

Workbook last-modified-by metadata.

**-Manager String optional**

Workbook manager metadata.

**-MarkFormulasDirty SwitchParameter optional**

Mark formula cells dirty before saving.

**-NoSave SwitchParameter optional**

Skip saving the workbook after running the DSL.

**-Open SwitchParameter optional**

Open the workbook in Excel after saving.

**-PassThru SwitchParameter optional**

Emit a FileInfo for convenience.

**-Password String optional**

Password used to save the workbook as an encrypted package.

**-Path String requiredposition: 0aliases: FilePath**

Destination path for the workbook.

**-SafePreflight SwitchParameter optional**

Run OfficeIMO worksheet preflight cleanup before saving.

**-SafeRepairDefinedNames SwitchParameter optional**

Repair common defined-name issues before saving.

**-Subject String optional**

Workbook subject metadata.

**-TemplatePath String optionalaliases: Template**

Optional workbook template package copied before running the DSL.

**-ValidateOpenXml SwitchParameter optional**

Validate the saved package with OpenXmlValidator and throw on errors.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

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