> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/excel/converttoxml.md).

# ConvertToXML

Converts Excel file to XML.

Task version: 2.0.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

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

## Task Parameters

{% tabs %}
{% tab title="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="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>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| UseNumbersAsColumnHeaders : `Boolean` | <p>If set to true, numbers will be used as column headers instead of letters (A = 1, B = 2...).</p><p><br>Default: <code>false</code><br>Example: <code>false</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>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ErrorMessageOnFailure : `String`      | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Excel conversion failed for input file.</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| DateFormat : `DateFormats`            | <p>Date format selection.</p><p>Possible values:</p><ul><li><code>DEFAULT</code>: Default format, will use <code>CurrentCulture.DateTimeFormat.ShortDatePattern</code></li></ul><p>for <code>ShortDatePattern</code> option is set to <code>true</code>, otherwise will use</p><p><code>CurrentCulture.DateTimeFormat.DateTimeFormat</code>.</p><ul><li><code>DDMMYYYY</code>: Will use <code>dd/MM/yyyy</code> if <code>ShortDatePattern</code> option is set to <code>true</code>,</li></ul><p>otherwise will use <code>dd/MM/yyyy H:mm:ss</code>.</p><ul><li><code>MMDDYYYY</code>: Will use <code>MM/dd/yyyy</code> if <code>ShortDatePattern</code> option is set to <code>true</code>,</li></ul><p>otherwise will use <code>MM/dd/yyyy h:mm:ss tt</code>.</p><ul><li><code>YYYYMMDD</code>: Will use <code>yyyy/MM/dd</code> if <code>ShortDatePattern</code> option is set to <code>true</code>,</li></ul><p>otherwise will use <code>yyyy/MM/dd H:mm:ss</code>.</p><p><br>Default: <code>DEFAULT</code><br>Example: <code>Default</code></p> |
| ShortDatePattern : `Boolean`          | <p>If set to true, dates will exclude timestamps from dates.</p><p>Default false</p><p><br>Default: <code>false</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {% endtab %}                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| {% endtabs %}                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

## Task Result

| Name                               | Description                                                                                                                    |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Success : `Boolean`                | <p>Conversion's status. False if conversion fails.<br>Example: <code>true</code></p>                                           |
| XML : `String`                     | <p>Excel-conversion to CSV.<br>Example: <code>workbook\_name, worksheet\_name, row\_header, column\_header</code></p>          |
| Error : `Error`                    | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p> |
| Error.Message : `String`           | <p>Summary of the error.<br>Example: <code>Error while converting Excel file to XML.</code></p>                                |
| Error.AdditionalInfo : `Exception` | <p>Additional information about the error.<br>Example: <code>object { Exception AdditionalInfo }</code></p>                    |

## Task Changelog

Changelog for Task Frends.Excel.ConvertToXML.

### \[2.0.0] - 2026-09-02

#### Changed

* \[Breaking Change] Replaced `ErrorMessage` (string) in the result object with a structured `Error` object containing `Message` and `AdditionalInfo`.
* Added standard failure handling options `ErrorMessageOnFailure`.
* Updated the task to target .NET 8.

### \[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-10

#### Change

* Documentation updates

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

#### Added

* Initial implementation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.frends.com/tasks/tasks/excel/converttoxml.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
