Hi Gert-Jan,
No, you don’t have to do anything like that. The .NET runtime will track all the COM references and clean them up as part of the garbage collection, if they have no more references to them.
See my post here: https://stackoverflow.com/a/38111137/44264 and similar.
The important rule, though, is to only ever talk to the Excel COM object model from the main thread (test that System.Threading.Thread.ManagedThreadId = 1).
That means you have to be careful with callbacks from timers, network, async and such cases.
You should never call the COM object model from another thread, but can set up work to be done on the main thread by calling ExcelAsyncUtil.QueueAsMacro.
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/exceldna/5741df0d-f102-4ae5-9f36-bafa67c7a9dfn%40googlegroups.com.