Hi Noor,
You should try to always do the COM interop with Excel from the main thread.
Otherwise there are various things that can go wrong – for example Excel is sometimes in a mode where most COM calls are directly rejected.
If you are triggering some COM interop work from another thread (like a ThreadPool thread running a Task) you need to find a way to schedule the COM interop work on the main thread.
In some cases (and inside the add-in) you can call ExcelAsyncUtil.QueueAsMacro to do this.
I’m a bit unsure of whether this would work in a test context, but you can try.
-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 on the web visit https://groups.google.com/d/msgid/exceldna/c4d6e15d-02f5-4bce-91b5-7783facdfedbn%40googlegroups.com.