How to use DotNet EXE as OLE object
I would like to insert my DotNet EXE application in excel sheet just like an OLE object. Is it possible? If yes, how we can do this.
In Excel 2003 when we click Insert->Object menu item, we get the 'Object' diloag. The 'Create New' tab of t开发者_JAVA百科his dilaog contains varios OLE objects. I would like to display my DotNet exe application in this list so that when I select and click the 'Ok' button of this dialog, EXE should execute like others OLE object of this list.
Thanks, Amit
Well, its been a long time since you asked, but I don't think that there is a reasonable way to achieve your goal in terms of making the WPF application an OLE object for direct embedding. The technologies are very different, and while there may be some obscure interop path through COM, you'd probably save a lot of time by taking a different approach.
For example, if you are just trying to 'launch' the application from Excel, make an OLE object that 'launches' your WPF application instead of trying to make them both the same thing.
As far as the interop is concerned, here is some more reading.
http://en.wikipedia.org/wiki/Object_Linking_and_Embedding#Interoperability
http://en.wikipedia.org/wiki/Component_Object_Model
http://en.wikipedia.org/wiki/COM_Interop
On a side note, this is an interesting question / technical challenge, but may not be worth your time at the end of the day.
精彩评论