# ExcelSheetCsvExtensions

Imports and exports worksheet data through the shared OfficeIMO.CSV pipeline.

Class 

`OfficeIMO.Excel.Csv`

**Namespace**

`OfficeIMO.Excel.Csv`

**Assembly**

`OfficeIMO.Excel.Csv`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[ExcelSheetCsvExtensions.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L18)

**Modifiers**

static

Imports and exports worksheet data through the shared OfficeIMO.CSV pipeline.

## Inheritance

- object
- ExcelSheetCsvExtensions

Filter members 

Show inherited

## Methods

ImportCsv 2 overloads

`public static ExcelCsvImportResult ImportCsv(ExcelSheet sheet, CsvDocument csv, ExcelCsvImportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-importcsv-officeimo-excel-excelsheet-officeimo-csv-csvdocument-officeimo-excel-csv-excelcsvimportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L18)

Imports a loaded CSV document into an existing worksheet.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**csv OfficeIMO.CSV.CsvDocument required**

**options OfficeIMO.Excel.Csv.ExcelCsvImportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`ExcelCsvImportResult`

`public static ExcelCsvImportResult ImportCsv(ExcelSheet sheet, Stream stream, ExcelCsvImportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-importcsv-officeimo-excel-excelsheet-io-stream-officeimo-excel-csv-excelcsvimportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L46)

Reads a caller-owned CSV stream and imports it into an existing worksheet.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**stream System.IO.Stream required**

**options OfficeIMO.Excel.Csv.ExcelCsvImportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`ExcelCsvImportResult`

`public static ExcelCsvImportResult ImportCsvFile(ExcelSheet sheet, string path, ExcelCsvImportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-importcsvfile-officeimo-excel-excelsheet-string-officeimo-excel-csv-excelcsvimportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L32)

Opens a CSV file and imports it into an existing worksheet.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**path string required**

**options OfficeIMO.Excel.Csv.ExcelCsvImportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`ExcelCsvImportResult`

`public static ExcelCsvImportResult ImportCsvText(ExcelSheet sheet, string text, ExcelCsvImportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-importcsvtext-officeimo-excel-excelsheet-string-officeimo-excel-csv-excelcsvimportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L62)

Parses CSV text and imports it into an existing worksheet. Because the input is already decoded, CsvReaderOptions.Encoding applies only to file and stream imports.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**text string required**

**options OfficeIMO.Excel.Csv.ExcelCsvImportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`ExcelCsvImportResult`

SaveAsCsv 2 overloads

`public static OfficeConversionReport SaveAsCsv(ExcelSheet sheet, string path, ExcelCsvExportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-saveascsv-officeimo-excel-excelsheet-string-officeimo-excel-csv-excelcsvexportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:94](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L94)

Streams worksheet values as CSV without materializing the target document.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**path string required**

**options OfficeIMO.Excel.Csv.ExcelCsvExportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`OfficeConversionReport`

`public static OfficeConversionReport SaveAsCsv(ExcelSheet sheet, Stream stream, ExcelCsvExportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-saveascsv-officeimo-excel-excelsheet-io-stream-officeimo-excel-csv-excelcsvexportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:108](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L108)

Streams worksheet values as CSV without materializing the target document.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**stream System.IO.Stream required**

**options OfficeIMO.Excel.Csv.ExcelCsvExportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`OfficeConversionReport`

SaveAsCsvAsync 2 overloads

`public static Task<OfficeConversionReport> SaveAsCsvAsync(ExcelSheet sheet, string path, ExcelCsvExportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-saveascsvasync-officeimo-excel-excelsheet-string-officeimo-excel-csv-excelcsvexportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:122](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L122)

Asynchronously streams worksheet values as CSV without materializing the target document.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**path string required**

**options OfficeIMO.Excel.Csv.ExcelCsvExportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<OfficeConversionReport>`

`public static Task<OfficeConversionReport> SaveAsCsvAsync(ExcelSheet sheet, Stream stream, ExcelCsvExportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-saveascsvasync-officeimo-excel-excelsheet-io-stream-officeimo-excel-csv-excelcsvexportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:128](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L128)

Asynchronously streams worksheet values as CSV without materializing the target document.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**stream System.IO.Stream required**

**options OfficeIMO.Excel.Csv.ExcelCsvExportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<OfficeConversionReport>`

ToCsv 2 overloads

`public static CsvDocument ToCsv(ExcelSheet sheet, ExcelCsvExportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-tocsv-officeimo-excel-excelsheet-officeimo-excel-csv-excelcsvexportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L73)

Projects the selected worksheet values into a materialized CSV model.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**options OfficeIMO.Excel.Csv.ExcelCsvExportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`CsvDocument`

`public static CsvDocument ToCsv(ExcelSheet sheet, ExcelCsvExportOptions? options, out OfficeConversionReport report, CancellationToken cancellationToken = default)` [#](#method-tocsv-officeimo-excel-excelsheet-officeimo-excel-csv-excelcsvexportoptions-officeimo-officeconversionreport-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L78)

Projects values and reports the limits of CSV fidelity for workbook features.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**options OfficeIMO.Excel.Csv.ExcelCsvExportOptions? required**

**report OfficeIMO.OfficeConversionReport required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`CsvDocument`

`public static Task<OfficeConversionResult<CsvDocument>> ToCsvAsync(ExcelSheet sheet, ExcelCsvExportOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-tocsvasync-officeimo-excel-excelsheet-officeimo-excel-csv-excelcsvexportoptions-threading-cancellationtoken)

[ExcelSheetCsvExtensions.cs:89](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Excel.Csv/ExcelSheetCsvExtensions.cs#L89)

Projects worksheet values asynchronously and returns the model and fidelity report.

Parameters

**sheet OfficeIMO.Excel.ExcelSheet required**

**options OfficeIMO.Excel.Csv.ExcelCsvExportOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<OfficeConversionResult<CsvDocument>>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:038D66AF835E51F73B86F38397E0F3C9075A1295CB03144ED331EB9F3E2DD2BB -->
