如何使用 DotNet EXE 作为 OLE 对象

发布于 2024-09-25 08:44:12 字数 253 浏览 0 评论 0原文

我想将我的 DotNet EXE 应用程序插入到 Excel 工作表中,就像 OLE 对象一样。是否可以?如果是的话,我们该如何做到这一点。

在 Excel 2003 中,当我们单击“插入”->“对象”菜单项时,我们会看到“对象”对话框。该对话框的“新建”选项卡包含各种 OLE 对象。我想在此列表中显示我的 DotNet exe 应用程序,以便当我选择并单击此对话框的“确定”按钮时,EXE 应该像此列表中的其他 OLE 对象一样执行。

谢谢, 阿米特

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 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.

Thanks,
Amit

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葵雨 2024-10-02 08:44:12

好吧,自从您提出这个问题以来已经很长时间了,但我认为没有合理的方法可以实现您的目标,即使 WPF 应用程序成为直接嵌入的 OLE 对象。这些技术非常不同,虽然通过 COM 可能存在一些模糊的互操作路径,但采用不同的方法可能会节省大量时间。

例如,如果您只是尝试从 Excel“启动”应用程序,请创建一个“启动”WPF 应用程序的 OLE 对象,而不是尝试使它们成为同一对象。

就互操作性而言,这里还有一些阅读内容。
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

附带说明,这是一个有趣的问题/技术挑战,但最终可能不值得您花时间。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文