Nowdays Iam developing application that use for read excel .So Once I run and close the application there are more than 5 excel.exe process are running.How to stop these process.Below I mention code which I used.

xlApp = new Excel.ApplicationClass();
             DataSet ds = new DataSet("DataSet"); xlWorkBook = xlApp.Workbooks.Open("C:\\Test.xls", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
            xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
            xlWorkSheet1 = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(2);


Are you wanting simply to read the data out of the Excel worksheet like a database, or are you making a front-end spreadsheet wrapper?

If you want to automate Excel then you're taking the right approach, if you're wanting to read data like a database then I would have a different suggestion.

Once you finish you can kill Excel process (IFF you don't need it anymore).

Thanks for reply.now it ok I got the coding that realase unwanted variables from memeory

if (xlWorkBook != null)

                        System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkBook); xlWorkBook = null;

                    // release the excel instance resources 

                    if (xlApp != null)


                        xlApp = null;
commented: thank you very much for sharing this beneficial information :) +7

Very nice solution and better a lot than one I gave, thank you very much for sharing this beneficial information :)