I would like to insert my wpf application in excel sheet just like an OLE object. Is it possible? If yes, how we can do this.
我想将我的wpf应用程序插入到excel表中,就像一个OLE对象一样。是可能的吗?如果是,我们怎么做。
In Excel 2003 when we click Insert->Object menu item, we get the 'Object' diloag. The 'Create New' tab of this 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.
在Excel 2003中,当我们点击Insert->对象菜单项时,我们会得到'Object' diloag。这个dilaog的“新建”选项卡包含变量OLE对象。我想在这个列表中显示我的DotNet exe应用程序,这样当我选择并单击这个对话框的“Ok”按钮时,exe应该像这个列表中的其他OLE对象一样执行。
Thanks, Amit
谢谢,阿米特
1 个解决方案
#1
0
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.
好吧,你问这个问题已经有很长一段时间了,但是我不认为有一种合理的方法可以实现你的目标,使WPF应用程序成为一个OLE对象,用于直接嵌入。技术是非常不同的,虽然通过COM可能会有一些模糊的互操作路径,但是使用不同的方法可能会节省很多时间。
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.
例如,如果您只是试图从Excel中“启动”应用程序,那么创建一个OLE对象来“启动”您的WPF应用程序,而不是试图使它们都是相同的。
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
至于互操作,这里有更多的阅读。http://en.wikipedia.org/wiki/Object_Linking_and_Embedding 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.
顺便说一句,这是一个有趣的问题/技术挑战,但可能不值得你在一天结束的时候花时间。
#1
0
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.
好吧,你问这个问题已经有很长一段时间了,但是我不认为有一种合理的方法可以实现你的目标,使WPF应用程序成为一个OLE对象,用于直接嵌入。技术是非常不同的,虽然通过COM可能会有一些模糊的互操作路径,但是使用不同的方法可能会节省很多时间。
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.
例如,如果您只是试图从Excel中“启动”应用程序,那么创建一个OLE对象来“启动”您的WPF应用程序,而不是试图使它们都是相同的。
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
至于互操作,这里有更多的阅读。http://en.wikipedia.org/wiki/Object_Linking_and_Embedding 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.
顺便说一句,这是一个有趣的问题/技术挑战,但可能不值得你在一天结束的时候花时间。