Question : How to copy the XLSX file to XLS file using C#

I want copy the data from XLSX file to XLS file in c#

Answer : How to copy the XLSX file to XLS file using C#


A correction in the above code in SaveAs method:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Excel.Application oXls = new Microsoft.Office.Interop.Excel.ApplicationClass();
                    
object oMissing = System.Reflection.Missing.Value;

Excel.Workbook oSpr = oXls.Workbooks.Open("ExcelData.xlsx", oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);

object fileFormat = Excel.XlFileFormat.xlXMLSpreadsheet;              
                   
oSpr.SaveAs(paramExportFilePath, ref fileFormat, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);

oSpr.Close();
oXls.Quit();
Random Solutions  
 
programming4us programming4us