I have an ASP.NET web site that creates Excel reports using
Microsoft.Office.Interop.Excel version 184.108.40.206. When the user clicks
a CreateReport button, an Excel application is created and disposed of
in the button click event as below:
using Excel = Microsoft.Office.Interop.Excel;
Excel.Application ExcelApp = new Excel.Application();
Normally, this removes the Excel COM object from memory at the end of
the button click event. However, if the user closes the browser (IE
7.0) window before the button click event has finished executing, what
method can I use to insure that the Marshal.ReleaseComObject(ExcelApp)
statement is executed and the Excel COM object is removed from
memory? I've been told that the server process containing my C# code
behind will be killed at some arbitrary point when it's detected that
the user's browser window was closed.
Thanks in advance!