Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created December 26, 2025 14:51
Show Gist options
  • Select an option

  • Save aspose-com-gists/babe0597809a7ce679628ed54768f6be to your computer and use it in GitHub Desktop.

Select an option

Save aspose-com-gists/babe0597809a7ce679628ed54768f6be to your computer and use it in GitHub Desktop.
Convert CSV to Excel in C# with Aspose.cells
using Aspose.Cells;
using System;
class CsvToExcelConverter
{
static void Main()
{
// Path to the CSV file
string csvPath = "input.csv";
// Path to the output Excel file
string excelPath = "output.xlsx";
// Load CSV file into a Workbook
LoadOptions loadOptions = new LoadOptions(LoadFormat.Csv);
Workbook workbook = new Workbook(csvPath, loadOptions);
// Save as XLSX format
workbook.Save(excelPath, SaveFormat.Xlsx);
Console.WriteLine("Conversion completed successfully.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment