|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OLE: Excel.ApplicationHello,
in VB.Net, I use Excel to display results : dim xl as new Excel.Application // creates an Excel process // snip (putting values into cells) xl.Visible = true If the user closes the Excel file, the Excel process remains in memory until my program is closed, which is good. If the user closes my program first and then the Excel file, the Excel process remains in memory ! How can I make sure the process will be killed ? Thanks ! Hello, myname,
You need to include a line like: xl.Quit in the appropriate place. But due to the vagaries of .Net garbage collection this may not result in immediate termination of the Excel application. For this you could add lines like: System.Runtime.InteropServices.Marshal.ReleaseComObject(...) . . . System.Runtime.InteropServices.Marshal.ReleaseComObject(xl) GC.Collect() GC.WaitForPendingFinalizers() where "..." refers to any Excel Workbook and Worksheet objects that you have opened. Cheers, Randy myname wrote: Show quoteHide quote > Hello, > > in VB.Net, I use Excel to display results : > > dim xl as new Excel.Application // creates an Excel process > // snip (putting values into cells) > xl.Visible = true > > If the user closes the Excel file, the Excel process remains > in memory until my program is closed, which is good. > > If the user closes my program first and then the Excel file, > the Excel process remains in memory ! > > How can I make sure the process will be killed ? > > Thanks ! > > > >
anonymous methods only available in C#?
VB2005 Hiding Windows Forms Setup project in VB.NET ? ErrorProvider in .Net 2003 Passing parameters best practice listView - filling it with datareader Help Needed. Update with parameters error - No value given for one or more parameters. declare API without direct file name determining line numbers upon error Making a domain lookup in asp.net |
|||||||||||||||||||||||