// Writing Quote Results to Excel public void SaveToExcel(int x, int y, string dataToSend, int sheetNum) { excel.Application Xapp = new excel.Application(); excel.Workbook xWorkbook = Xapp.Workbooks.Open(ExcelFileLocationWork); try { excel.Worksheet xWorksheet = xWorkbook.Sheets[sheetNum]; excel.Range xRange = xWorksheet.UsedRange; xRange.Cells[x, y] = dataToSend; xWorkbook.Save(); } finally { xWorkbook.Close(true); Xapp.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComObject(Xapp); } }