I am trying to export data from my C# code to MS Excel 2007, but it is taking 30 seconds to insert data in an excel file.The code is like this->
Excel.Application excelapp = new Excel.Application();
Excel.Workbook excelworkbook = excelapp.Workbooks.Open(fileTest);
Excel.Sheets excelsheets = excelworkbook.Worksheets;
Excel.Worksheet mysheets = (Excel.Worksheet)excelsheets.get_Item("Sheet1");
Excel.Range mycells = mysheets.Cells;
mycells.Item[destroyer, "A"].Value = s[2];
mycells.Item[destroyer, "B"].Value = s[1];
mycells.Item[destroyer, "C"].Value = s[3];
mycells.Item[destroyer, "D"].Value = dbl_standard.Text;
mycells.Item[destroyer, "E"].Value = s[4];
mycells.Item[destroyer, "F"].Value = s[7];
mycells.Item[destroyer, "G"].Value = s[5];
mycells.Item[destroyer, "H"].Value = s[6];
excelworkbook.Save();
excelworkbook.Close();
excelapp.Quit();
Marshal.ReleaseComObject(mycells);
Marshal.ReleaseComObject(mysheets);
Marshal.ReleaseComObject(excelsheets);
Marshal.ReleaseComObject(excelworkbook);
Marshal.ReleaseComObject(excelapp);
I am inserting hardly 25 columns.Which thing am I doing wrong?How to make it fast?
Thanks in Advance