# ConvertTo-OfficeExcelWorkbook

Converts Excel workbooks between supported .xls and .xlsx formats.

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 **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`System.IO.FileInfo`

**Source**

[ConvertToOfficeExcelWorkbookCommand.cs:26](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/ConvertToOfficeExcelWorkbookCommand.cs#L26) 

Converts Excel workbooks between supported .xls and .xlsx formats.

## Syntax

```
ConvertTo-OfficeExcelWorkbook
[-AllowLossyLegacyConversion]
[-Force]
[-Open]
[-OutputPath] <String>
[-PassThru]
[-Path] <String>
[<CommonParameters>]
```

[#](#method-convertto-officeexcelworkbook-switchparameter-switchparameter-switchparameter-string-switchparameter-string)

Parameter set: `All Parameter Sets`

## Description

Uses the OfficeIMO Excel normal load/save conversion path, including legacy XLS diagnostics and save preflight.

## Examples

### Convert a legacy XLS file to XLSX.

```powershell
ConvertTo-OfficeExcelWorkbook -Path .\legacy.xls -OutputPath .\converted.xlsx -PassThru
```

Reads the .xls file and writes a .xlsx workbook.

### Convert an XLSX workbook to native XLS.

```powershell
ConvertTo-OfficeExcelWorkbook -Path .\report.xlsx -OutputPath .\report.xls -Force
```

Writes a supported native BIFF8 .xls workbook.

## Parameters

**-AllowLossyLegacyConversion SwitchParameter optional**

Allow conversion when a legacy XLS source contains unsupported or preserve-only content.

**-Force SwitchParameter optional**

Overwrite an existing destination file.

**-Open SwitchParameter optional**

Open the converted workbook after saving.

**-OutputPath String requiredposition: 1aliases: OutPath**

Destination .xls or .xlsx file path.

**-PassThru SwitchParameter optional**

Emit the saved file information.

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

Source .xls or .xlsx file path.

## 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:411EE928B7D3F679012AEF733F3C1041D5B1B91F05EF492289B63196FCFE30AF -->
