Link to home
Start Free TrialLog in
Avatar of gokyo66
gokyo66

asked on

Can't stop EXCEL.EXE process

Hello there experts,
got a excel program wrote in VBA that works great, I open it, it does what it has to do, I close and the process is terminated.

Now, since this program have to be launched inside a C# program in this case everything works fine but when I close the Excel program the Excel process stay in memory and I have to kill the process thru Task Manager.

For the sake of this post I'have to say that once the C# program open excel the user got the chance to work with excel, is not just open the excel file read information and close it.

I use to close the application:



xlApp.Quit() //where xlApp = new Microsoft.Office.Interop.Excel.Application()

System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of kris_per
kris_per

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gokyo66
gokyo66

ASKER

Thank you Kris
This must work in C#, but doesn't in vb .net.

I've even tried using your method to create the object:
xlApp = New Microsoft.Office.Interop.Excel.Application()