Excel add-in temporarily hangs Excel

P

pmt32577

I have created an add-in using ATL.
It connects in OK, I can add a menu item. I have implemented a sink for the
menu item event.
In the event handler I create a Dialog box. However, after about 30 seconds
Excel starts flashing away that it is waiting for an OLE call to finish. When
I finish with the Dialog box then for the first time only Excel then hangs on
the screen refresh for about 30 seconds and then carries on OK.

When I try to set Application.DisplayAlerts to False to try and stop the
first problem then I get into deadlock on the Invoke call.

I presume this is a COM apartment/threading issue but would appreciate some
help!

I have tried both free threading and apartment versions, single and multi
threaded and no change.

Thanks

Mick
 
P

pmt32577

I eventually bypassed the problem by ripping out all the ATL stuff and hard
coding all my required interfaces along the same lines as the ComAddIn
example. I can only assume that ATL was doing something wierd with threading
and/or apartments that was upsetting Excel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top