Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

Import, Export, and Publish Excel Data

Edit on GitHub

Move delimited data into Excel, export workbook visuals and HTML, and choose the right publishing surface for downstream readers.

Excel often sits in the middle of a pipeline: CSV or application data arrives, a workbook adds formulas and presentation, and selected results are published as images, HTML, or another workbook.

Import delimited text

Read CSV or other delimited input with Import-OfficeCsv, then pass its rows to Export-OfficeExcel. Specify the delimiter and culture rather than relying on machine defaults.

Import-OfficeCsv -Path '.\Sales.csv' -Delimiter ';' -Culture en-US |
    Export-OfficeExcel -Path '.\Report.xlsx' -Sheet Sales -Append

The delimited-import recipe imports an existing semicolon-delimited file into a named worksheet.

Publish the useful part

Use Export-OfficeDocumentImage with -Sheet and -Range for a bounded report region, -Sheet and -Chart for a chart, or -OutputDirectory for worksheet images. Use -OutputPath only when the selection produces one image. HTML export is useful for review without Excel. Export-OfficeExcel turns PowerShell objects into a new or appended workbook when the pipeline begins with objects rather than an existing file.

Choose the smallest artifact that preserves the intended experience. A range image is good for a status message; an XLSX is better when recipients must filter, inspect formulas, or continue editing.

Example source