# ConvertToCSV

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Excel/tree/main/Frends.Excel.ConvertToCSV>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name            | Description                                                                                                                         |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Path : `String` | <p>Path to the Excel file.</p><p><br>Default: <code>C:\tmp\ExcelFile.xlsx</code><br>Example: <code>C:\tmp\ExcelFile.xlsx</code></p> |
| {% endtab %}    |                                                                                                                                     |

{% tab title="Parameter: Options" %}

| Name                                 | Description                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ReadOnlyWorkSheetWithName : `String` | <p>If empty, all work sheets are read.</p><p><br>Default: <code>-</code><br>Example: <code>Sheet2</code></p>                                                                                                                                                                                                                                                                                               |
| CsvSeparator : `String`              | <p>Csv separator.</p><p><br>Default: <code>;</code><br>Example: <code>;</code></p>                                                                                                                                                                                                                                                                                                                         |
| ThrowErrorOnFailure : `Boolean`      | <p>Choose if exception should be thrown when conversion fails.</p><p><br>Default: <code>true</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                      |
| DateFormat : `DateFormats`           | <p>Date format selection.</p><p>Possible values:</p><ul><li><code>DEFAULT</code>:</li></ul><p>Date format selection.</p><ul><li><code>DDMMYYYY</code>:</li></ul><p>Date format selection.</p><ul><li><code>MMDDYYYY</code>:</li></ul><p>Date format selection.</p><ul><li><code>YYYYMMDD</code>:</li></ul><p>Date format selection.</p><p><br>Default: <code>0</code><br>Example: <code>Default</code></p> |
| ShortDatePattern : `Boolean`         | <p>If set to true, dates will exclude timestamps from dates.</p><p><br>Default: <code>false</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                      |
| {% endtab %}                         |                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="Result: Result" %}

| Name                    | Description                                                                                                                              |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`     | <p>Conversion's status. False if conversion fails.<br>Example: <code>false</code></p>                                                    |
| CSV : `String`          | <p>Excel-conversion to CSV.<br>Example: <code>"Foo,Bar,Kanji 働,Summa\r\n1,2,3,6\r\nKuva,1,2,3\r\n,,,\r\nFoo,,,\r\n,Bar,,\r\n"</code></p> |
| ErrorMessage : `String` | <p>Exception message.<br>Example: <code>Error while converting Excel file to CSV</code></p>                                              |
| {% endtab %}            |                                                                                                                                          |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0] - 2026-01-22

#### Fixed

* Open Excel files with FileAccess.Read to support read-only files

### \[1.0.2] - 2023-08-01

#### Fixed

* Fixed Options.ShouldReadSheet method to check if the Sheet name equals to the given name.

### \[1.0.1] - 2022-08-05

#### Change

* Documentation updates

### \[1.0.0] - 2022-02-24

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
