private void ExcelFileToCSVFile(string ExcelFile, string CSVFile)
{
object missing = System.Reflection.Missing.Value;
Excel.Application excel = new Excel.Application();
excel.Visible = false;
Excel.Workbooks oBooks = excel.Workbooks;
oBooks.Open(ExcelFile, missing, missing, missing, missing, missing, missing, missing,
missing, missing, missing, missing, missing); Excel.Workbook oBook = excel.ActiveWorkbook;
oBook.SaveAs(CSVFile, XlFileFormat.xlCSV, missing, missing, missing, missing, 
Excel.XlSaveAsAccessMode.xlNoChange, missing, missing, missing, missing);
excel.DisplayAlerts = false;
oBook.Close(false, missing, false);
System.Runtime.InteropServices.Marshal.ReleaseComObject(oBook);
oBook = null; System.Runtime.InteropServices.Marshal.ReleaseComObject(oBooks);
oBooks = null; excel.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(excel);
excel = null;
System.GC.Collect();
}