AnsweredAssumed Answered

C# Release Excel Objects

Question asked by kivela on Jun 23, 2014
Latest reply on Jun 24, 2014 by kivela
I have an application written in C# that runs from within ArcMap and it creates an Excel file on the fly using Microsoft.Office.Interop.Excel objects.

It works fine except the Excel process hangs until you close ArcMap.

In the code I save and close the workbook object, quit the Excel application object and then do a Marshal.ReleaseComObject on them.

I thought this was supposed to terminate the Excel process but that doesn't happend until ArcMap is closed.

I had a VB6 version of this application and in that case I did a save and close on the workbook object, quit the Excel application object and set them all = Nothing.  This worked as the Excel process ended when the application completed running, you didn't have to close ArcMap.

So... anybody know what else I have to do in C# to make the Excel process terminate, without closing ArcMap?

Thanks.

Attachments

Outcomes