There are several resources out there that explain how to add WinForms controls to Excel. See these two:
http://msdn.microsoft.com/en-us/library/vstudio/e3zbk0hz%28v=vs.100%29.aspx
http://www.clear-lines.com/blog/post/create-excel-2007-vsto-add-in-wpf-control.aspx
Both of them mention the more up-to-date option of using WPF controls (the one I need). Unfortunately, both resources are lacking the fundamental part. There is a missing link:
(1) The Microsoft site mentions some video -with the exact title that matches my requirement- but all videos in that web site have been removed, it seems.
(2) The Clear-Lines site contains an outstanding, step-by-step project but alas, when the critical part is mentioned, the author uses some facility (the "WPF Interoperability section of the Toolbox") that does not exist in VS-2010+
Based on the above screenshots, and other sites, I have come to the conclusion that the missing link, the connection between my WPF UserControl and its appearance in Excel is some ElementHost
.
Addendum for @HighCore. See Toolbox below:
Esteemed Self:
Your problem is that you are trying to place a WPF Control inside another WPF Control.
You need to create an old-fashioned WinForm Control and next you use the Toolbox as depicted here:
Notice that the section ElementHost Tasks has been renamed WPF Interoperability but it is otherwise very much alive.
From MSDN Magazine:
http://msdn.microsoft.com/en-us/magazine/cc163292.aspx#S4
I'm not sure why you think there's a "missing link". The ElementHost is the standard way to host WPF content on winforms, and it's perfectly documented in the link above, and also here.
given any winforms container (such as a
Form
orPanel
), simply do:make sure you add references to these assemblies:
PresentationCore
PresentationFramework
System.Xaml
WindowsBase
WindowsFormsIntegration