public static string ConvertOldExcelFile(string excelFilePath)
{
string ext = Path.GetExtension(excelFilePath).ToLower();
if (ext.Trim() == ".xls")
{
MiscUtil.ConvertOldExcelFiletoNewFormat(excelFilePath);
excelFilePath += "x";
}
return excelFilePath;
}
public static void ConvertOldExcelFiletoNewFormat(string excelFile)
{
var app = new Microsoft.Office.Interop.Excel.Application();
var wb = app.Workbooks.Open(excelFile);
wb.SaveAs(Filename: excelFile + "x", FileFormat: Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLWorkbook);
wb.Close();
app.Quit();
}