2

I'm developing a VSTO add-in for PowerPoint, Excel and Word. It has some Windows and Custom Task Panes that use winforms.

I've noticed that if add an ElementHost to one of these forms component and display it at least once, I will experience a 5 to 10 seconds delay when I close Excel or Word. There is no problem in PowerPoint.

The problem is apparently caused by devices that fit the 'Human Interface Devices' in windows' Device Manager. I've found this thread where someone had the same problem and solved it by deactivating such a device. This solution also works for my laptop, at the steep price of losing my touch screen. Since the add-in I'm working on is deployed to thousands of users, I'm looking for better solution.

Is there any other way to fix the problem without losing any touch screen capabilities, preferably directly in my add-in code, or by installing a patch for windows ?

There are several things I would like to precise :

  • The problem I'm having is NOT machine specific. I've tried a dozen different computers. It doesn't matter which brand or model it is (lenovo, surface, etc...), as long as it has a touch screen, the bug is here. Also, 'normal' computers have the same bug when I'm connected using RDP.
  • The problem seems to be limited to Excel and Word 2016 (not PowerPoint)
  • It seems the bug was fixed already in a previous version of VSTO, but now it's back. See here
  • The bug is here even if don't put anything in my ElementHost. I just declare a new ElementHost, add it to my Controls collection, and that's it.
  • Disposing the ElementHost, setting child and parent to nothing, removing it from the Controls collection, garbage collecting, etc... doesn't help in any way.
  • Most of the machines at my disposal are Windows 10, so it could be that the problem is limited to Windows 10
misterfrb
  • 305
  • 2
  • 10
  • I've seen this too. My device had never had a touch screen or any kind of drawing device attached. I submitted another question [here](https://connect.microsoft.com/VisualStudio/feedback/details/2659691/word-is-slow-to-close-when-an-embedded-wpf-control-is-added-to-the-actions-pane) (although you can't view it since they've turned off Connect...) but was never able to get it resolved. It went away at some point and I don't know why. I have always used Windows 7 and only saw it in Office 2010 (I'm on 2013 now). – Chris Jul 30 '18 at 13:54
  • Did u ever get this solved? – dotNET Nov 06 '18 at 16:32
  • With the latest office insider updates, it is apparently fixed on the machines that don't have any touch capabilities. Our touche devices (Surfaces Pro and Surface Books) still have the problem though. – misterfrb Nov 07 '18 at 17:17

0 Answers0