Excel process doesn't shut down

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am writing c# web application with Excel 2000.
My code is:

Excel.Application EXL;
EXL = new Excel.Application();
Excel.Worksheet WSheet = new Excel.WorksheetClass();
string FileName = MapPath(".") + "\\..xls";
WSheet = (Excel.Worksheet)EXL.Workbooks.Open(FileName, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing).Worksheets.get_Item(1);
Excel.Range rng = WSheet.get_Range("H12", Type.Missing);
string H12 = "H12: " + rng.Value2.ToString();
EXL.Workbooks.Close();
EXL.Quit();

Although I use EXL.Quit, Excel process doesn't shut down (still running at
windows task manager). Why?

Thank you.
 
¤ Hello,
¤ I am writing c# web application with Excel 2000.
¤ My code is:
¤
¤ Excel.Application EXL;
¤ EXL = new Excel.Application();
¤ Excel.Worksheet WSheet = new Excel.WorksheetClass();
¤ string FileName = MapPath(".") + "\\..xls";
¤ WSheet = (Excel.Worksheet)EXL.Workbooks.Open(FileName, Type.Missing,
¤ Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
¤ Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
¤ Type.Missing).Worksheets.get_Item(1);
¤ Excel.Range rng = WSheet.get_Range("H12", Type.Missing);
¤ string H12 = "H12: " + rng.Value2.ToString();
¤ EXL.Workbooks.Close();
¤ EXL.Quit();
¤
¤ Although I use EXL.Quit, Excel process doesn't shut down (still running at
¤ windows task manager). Why?

See if the following helps:

http://support.microsoft.com/default.aspx?scid=kb;en-us;317109

You also need to make certain that you destroy all Excel objects you create.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top