如何为Excel Online添加插件?

时间:2016-09-09 22:23:09

标签: c# excel plugins web-applications

我想从浏览器中使用Excel功能。我目前有一个基于Excel的Microsoft办公应用程序。它为功能区添加了一个图标,并使基于C#的自定义应用程序逻辑与数据库服务器进行通信。

由于它需要针对架构中的任何更改的应用程序版本,我很好奇,如果我可以将其转换为Web应用程序并仍然受益于Excel的内置功能。<​​/ p>

我希望这是可能的,因为Microsoft Excel Online是在浏览器中运行的。我的问题是,是否可以在这样的在线Excel文档中添加插件?如果是的话,任何一个例子都会非常感激。

1 个答案:

答案 0 :(得分:2)

You absolutely can, and depending on approach you can do so with nothing more than a VSTO project template. This is little more than a ClickOnce application. This can launch a browser within a window to perform the logic.

You may use the Office Interop assemblies to decouple your application from Office apps, yet still communicate easily. Make sure you set Embed Interop Assemblies to true once added as a reference.

For those using Office in the browser, it seems as though Microsoft is shifting into CSOM/JSON/REST, meaning this solution is coded entirely differently than COM. This should help you get started:

https://msdn.microsoft.com/EN-US/library/office/dn268594.aspx.