How to convert xls file to xlsx file using C#?
问题 I was developing an application which read data from an excel file, but when I try to open it, an exception was thrown if the source file is saved with the xls format (File contains corrupted data error when opening Excel sheet with OpenXML). indeed when I save this file with the xlsx format it works fine. please help me to solve this problem. 回答1: Use Free Spire.XLS dll available via NuGet. Sample: Workbook workbook = new Workbook(); workbook.LoadFromFile("Input.xls"); workbook.SaveToFile(