# Set-OfficeExcelRichText

Sets mixed-format rich text runs in an Excel cell. 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 **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelRichText

**Module**

`PSWriteOffice`

**Aliases**

`ExcelRichText`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelRichTextCommand.cs:18](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelRichTextCommand.cs#L18) 

Sets mixed-format rich text runs in an Excel cell.

## Syntax

```
Set-OfficeExcelRichText
[-Address <String>]
[-Column <Int32>]
[-PassThru]
[-Row <Int32>]
-Run <Object[]>
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelrichtext-string-int32-switchparameter-int32-object-string-int32)

Parameter set: `Context`

```
Set-OfficeExcelRichText
[-Address <String>]
[-Column <Int32>]
[-PassThru]
[-Path] <String>
[-Row <Int32>]
-Run <Object[]>
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelrichtext-string-int32-switchparameter-string-int32-object-string-int32)

Parameter set: `Path`

```
Set-OfficeExcelRichText
[-Address <String>]
[-Column <Int32>]
-Document <ExcelDocument>
[-PassThru]
[-Row <Int32>]
-Run <Object[]>
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelrichtext-string-int32-exceldocument-switchparameter-int32-object-string-int32)

Parameter set: `Document`

## Examples

### Write a status label with a bold colored value.

```powershell
ExcelSheet 'Summary' {
    Set-OfficeExcelRichText -Address A1 -Run 'Status: ', @{ Text = 'Blocked'; Bold = $true; Color = '#C00000' }
}
```

Stores inline rich text in the target cell using OfficeIMO's reusable rich-text cell model.

## Parameters

**-Address String optional**

A1-style cell address.

**-Column Int32 optional**

1-based column index.

**-PassThru SwitchParameter optional**

Emit written rich text runs.

**-Row Int32 optional**

1-based row index.

**-Run Object[] requiredaliases: Runs**

Rich text runs. Each run can be a string, hashtable, PSCustomObject, or ExcelRichTextRun.

**-Sheet String optionalaliases: WorksheetName**

Worksheet name. Defaults to the current sheet inside an ExcelSheet block.

**-SheetIndex Int32 optional**

Worksheet index when using a workbook object or path.

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

Workbook path to update.

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Workbook to update outside the DSL context.

## 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:7960A1677C1486B39451939D7FF217ACF0BD869056E236EDEC320908F0CCC276 -->
