Project

PSWriteOffice

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

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Export-OfficeExcelChartImage

Module
PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
OfficeIMO.Drawing.OfficeImageExportResult

Exports one named worksheet chart as an image file.

Syntax

Export-OfficeExcelChartImage
-ChartName <String>
[-Force]
[-Format <OfficeImageExportFormat>]
[-Options <ExcelImageExportOptions>]
[[-OutputPath] <String>]
[-PassThru]
[-Path] <String>
-WorksheetName <String>
[<CommonParameters>]
#
Parameter set: Path
Export-OfficeExcelChartImage
-ChartName <String>
-Document <ExcelDocument>
[-Force]
[-Format <OfficeImageExportFormat>]
[-Options <ExcelImageExportOptions>]
[[-OutputPath] <String>]
[-PassThru]
-WorksheetName <String>
[<CommonParameters>]
#
Parameter set: Document

Examples

Export a chart for inline use in an email.

Export-OfficeExcelChartImage -Path .\Report.xlsx -WorksheetName Summary -ChartName TicketStatus -OutputPath .\ticket-status.png

Parameters

-ChartName String required
Chart name as stored in the worksheet drawing layer.
-Force SwitchParameter optional
Replace an existing destination file.
-Format OfficeImageExportFormat optional
Output image format.
Possible values: Png, Svg, Jpeg, Tiff, Webp, Bmp, Pbm, Tga, Icon
-Options ExcelImageExportOptions optional
Optional rendering, size, font, and diagnostic policy settings.
-OutputPath String optionalposition: 1
Optional destination image file. When omitted, returns the in-memory image result only.
-PassThru SwitchParameter optional
Emit the structured image export result when a destination path is used.
-Path String requiredposition: 0sets: Path
Path to the workbook.
-WorksheetName String required
Name of the worksheet containing the chart.
-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document
Open workbook instance.

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.