Hi cdj,
I've tried the approach I gave you using the Microsoft Office
references(Early Binding) and in fact it still gives the desired effect. I
tried it out in a button click handler on a form. The following code does
nothing fancy, all it does is show Excel, waits for 5 seconds then quits
Excel again. If you use Task Manager you should be able to see the excel
process coming alve and then being unloaded from memory
private void button1_Click(object sender, EventArgs e)
{
Microsoft.Office.Interop.Excel.ApplicationClass App = new
Microsoft.Office.Interop.Excel.ApplicationClass();
App.Visible = true;
System.Threading.Thread.Sleep(5000);
App.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(App);
}
Hope this helps.
Stuart King
Informology Ltd.
>> Hi cdj,
>>
[quoted text clipped - 6 lines]
> My project's references to the Excel 11.0 object library are added
> before I compile - I take it that's a "no" to your question?
sherifffruitfly - 31 Oct 2006 20:03 GMT
> System.Runtime.InteropServices.Marshal.ReleaseComObject(App);
That line (which I didn't understand the first time you mentioned it)
solved all problems.
Thanks a million!
cdj