Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active September 22, 2022 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/dc8b6ddbd18db9adf2897a75769b5cdb to your computer and use it in GitHub Desktop.
Save aspose-com-gists/dc8b6ddbd18db9adf2897a75769b5cdb to your computer and use it in GitHub Desktop.
Convert CSV to Excel or XLSX/XLS to CSV with C# VB.NET
// Create LoadOptions for CSV file
LoadOptions loadOptions = new LoadOptions(LoadFormat.CSV);
// Create a Workbook object and initialize with CSV file's path and the LoadOptions object
Workbook workbook = new Workbook("Sample.csv", loadOptions);
// Save CSV file as XLSX
workbook.Save("CSVtoExcel.xlsx", SaveFormat.Xlsx);
// Load the input Excel file
Workbook workbook = new Workbook("CSVtoExcel.xlsx");
// Save XLSX as CSV file
workbook.Save("ExcelToCSV.csv", SaveFormat.CSV);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment