# Troubleshooting

## Exported file is corrupt and will not open in Excel 2003 or Excel 2007

Check for invalid DateTime values, such as "0001-01-01T00:00:00.000". MS Excel does not support DateTime values before "1900-01-01". UPDATE: Since R1 2010 the **ExportToExcelML** method validates the date values and throws a FormatException with message: "The DateTime value is not supported in Excel!".

## RadGridView Cannot Export Images

Images cannot be exported to MS Excel, because Excel does not support embedded images in cells. In addition, the [ExportToExcelML](https://www.telerik.com/products/winforms/documentation/controls/gridview/features/exporting-data/export-to-excel-via-excelml-format) method uses a special XML format which cannot include images by specification.

## Exporting data programmatically creates a blank Excel document

Since **ExportToExcelML iterates** through the grid elements, it does not export anything if the grid has not created its child elements yet (i.e. if there is a grid instance but it is not shown on a form). The solution is to use the **LoadElementTree** method before running the export: 

```C#
this.radGridView1.LoadElementTree();
```

```VB.NET
Me.RadGridView1.LoadElementTree()
```

## MS Excel does not open the file directly after exporting the data from RadGridView (it prompts to save the file instead)

The ExportToExcelML class does not support opening the excel file directly. However, you can easily implement similar functionality through the **Process.Start** method:

```C#
ExportToExcelML exporter = new ExportToExcelML(this.radGridView1);
exporter.RunExport(@"C:\Test.xls");
System.Diagnostics.Process.Start(@"C:\Test.xls");
```

```VB.NET
Dim exporter As ExportToExcelML = New ExportToExcelML(Me.RadGridView1)
exporter.RunExport("C:\Test.xls")
System.Diagnostics.Process.Start("C:\Test.xls")
```

## Wrong text alignment for rows with conditional formatting

**ExportToExcelML** does not support all text alignment settings for the conditional formatting; because of this ExportToExcelML takes and applies current conditional formatting alignments, but RadGridView skips the default values. This will be improved in future versions of RadGridView, but there is a workaround we can suggest, so feel free to open a [support ticket](http://www.telerik.com/account/support-tickets.aspx) to request it.

## See Also

* [Export Data in a Group to Excel](https://www.telerik.com/products/winforms/documentation/controls/gridview/features/exporting-data/export-data-in-a-group-to-excel)

* [Export to CSV](https://www.telerik.com/products/winforms/documentation/controls/gridview/features/exporting-data/export-to-csv)

* [Export to Excel via ExcelML Format](https://www.telerik.com/products/winforms/documentation/controls/gridview/features/exporting-data/export-to-excel-via-excelml-format)

* [Export to PDF](https://www.telerik.com/products/winforms/documentation/controls/gridview/features/exporting-data/export-to-pdf)

* [Export to HTML](https://www.telerik.com/products/winforms/documentation/controls/gridview/features/exporting-data/html-export)

* [Overview](https://www.telerik.com/products/winforms/documentation/controls/gridview/features/exporting-data/overview)

* [Export to Excel](https://www.telerik.com/products/winforms/documentation/controls/gridview/features/exporting-data/spread-export)
