Hello,
you can try using GemBox.Spreadsheet .NET library. It is much more easier to use than Excel Automation.
Here is a sample C# code how to export DataSet to Excel:
Code:
// Create new ExcelFile.
var ef = new ExcelFile();
// Imports all the tables from DataSet to new file.
foreach (DataTable dataTable in dataSet.Tables)
{
// Add new worksheet to the file.
var ws = ef.Worksheets.Add(dataTable.TableName);
// Insert the data from DataTable to the worksheet starting at cell "A1".
ws.InsertDataTable(dataTable, "A1", true);
}
// Save the file to XLS format.
ef.SaveXls("DataSet.xls");