Setting VSTO CustomTaskPane DockPosition is slow in Office2013
Asked Answered
J

1

6

I'm making an Excel Add-in which has a CustomTaskPane. On load I try to set the dockposition, height and width of the custom taskpane. Setting these properties executes almost immediately on Excel2010, but with Excel2013 it takes almost two seconds.

I've seen a question on MSDN about this, but no real answer was given. Are other people having this issue, and is there a workarround?

Jaymejaymee answered 28/10, 2014 at 17:34 Comment(0)
F
-1

Yes I do also have this problem. I think this has become an issue since Excel 2013 is now SDI (Single Document Interface), which means each workbook has its own visibility states for the custom taskpanes that were application scoped up to Excel 2010.

A Workaround to increase speed: It is still slower than Excel 2007 and Excel 2010, but you can disable the new Office 2013 animations in the registry to increase speed a lot, see Disable Excel 2013 cell animation.

Foulmouthed answered 19/1, 2015 at 15:53 Comment(4)
This does not answer the question, and the link no longer works. I observed this same problem in Excel 2013. When I comment out the lines setting Width and DockPosition properties, things run 2-3x faster. This may have something to do with Office animations, as suggested, but what does a developer do about it?Nessi
@OfficeAddinDev: Fixed no longer working link. I know that this is only a workaround, but there is no better solution I know, if you have to set the Width and DockPosition properties. So: The last question was. Is there a workaround - and I have posted a valid answered to this. No need to vote down...Foulmouthed
The OP is looking for a programmatic solution, which this link does not address. In testing I found that setting Application.ScreenUpdating = False before setting the Width and DockPosition properties can improve performance slightly (10-30% in my case).Nessi
Thanks for this tip!Foulmouthed

© 2022 - 2024 — McMap. All rights reserved.