Created
November 17, 2020 23:22
-
-
Save farhan-raza/07cc9a90227fd8684e4265115ef0cb5f to your computer and use it in GitHub Desktop.
Convert CSV to Excel or XLSX/XLS to CSV with C# VB.NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Opening CSV Files | |
// Creating CSV LoadOptions object | |
LoadOptions loadOptions = new LoadOptions(LoadFormat.CSV); | |
// Creating an Workbook object with CSV file path and the loadOptions | |
// object | |
Workbook workbook = new Workbook(dataDir + "Sample.csv", loadOptions); | |
workbook.Save(dataDir + "CSVtoExcel.xlsx", SaveFormat.Xlsx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the input Excel file | |
Workbook workbook = new Workbook(dataDir + "CSVtoExcel.xlsx"); | |
// Save output CSV file | |
workbook.Save(dataDir + "ExcelToCSV.csv", SaveFormat.CSV); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment