Open csv and save as xlsx

Hi

Im using Syncfusion for the first time, and i Need to open a csv file and save it as xlsx. When the file is saved, it cant opened with MS Excel 2013, ist being corrupt. My Code below:


ExcelEngine excelEngine = new ExcelEngine();

IApplication application = excelEngine.Excel;

IWorkbook workbook = await application.Workbooks.OpenAsync(myCSVFile, ",");

StorageFile myXLSXFile = await localFolder.CreateFileAsync("file.xlsx", CreationCollisionOption.ReplaceExisting);

await workbook.SaveAsAsync(myXLSXFile);

workbookToExport.Close();

excelEngine.Dispose();


What did i made wrong?


2 Replies

AN andy-dev January 8, 2016 01:07 PM UTC

I found the issue, i had to set the Version

workbookToExport.Version = ExcelVersion.Excel2013;



DB Dilli Babu Nandha Gopal Syncfusion Team January 11, 2016 06:30 AM UTC

Hi Andy,

We are glad to know that your issue has been resolved. Please let us know if you need any clarification.

Regards,
Dilli babu.

Loader.
Up arrow icon