MS Office Visual Studio 加载项、共享加载项和 Excel 2010 加载项之间有什么区别?
我正在使用 Visual Studio 2010 创建新的 Excel 加载项。理想情况下,我希望它能够与 Excel 2011 (Mac)、2010 和 2007 一起使用。
当我启动新的 C# 项目时,可以选择三个模板选项。
(Office) Excel 2010 加载项
(扩展性) Visual Studio 加载项
(可扩展性)共享外接程序
这些模板选择之间有什么区别?
提前致谢。
I am using Visual Studio 2010 to create a new add-in for Excel. Ideally I would like it to work with Excel 2011 (Mac), 2010, and 2007.
There are three template options to choose from when I start a new C# project.
(Office) Excel 2010 Add-in
(Extensibility) Visual Studio Add-in
(Extensibility) Shared Add-in
What are the differences between these template choices?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自女士。顾名思义,您可能想要使用共享加载项。
为 Excel 2007 或 Excel 2010 创建应用程序级加载项。有关详细信息,请参阅应用程序级加载项和 Excel 解决方案编程入门。
Visual Studio 外接程序向 Visual Studio 和 Visual Studio 宏环境添加功能。有关详细信息,请参阅如何:创建加载项。
共享外接程序可以向一个或多个 Microsoft Office 应用程序以及 Visual Studio 添加功能。有关详细信息,请参阅如何:创建加载项。
参考: http://msdn.microsoft.com/en-us/library/0fyc0azh .aspx
From MS. As the name implies, you probably want to use shared add-in.
Creates an application-level add-in for Excel 2007 or Excel 2010. For more information, see Getting Started Programming Application-Level Add-Ins and Excel Solutions.
Visual Studio Add-ins add functionality to the Visual Studio and Visual Studio Macros environments. For more information, see How to: Create an Add-In.
Shared Add-ins can add functionality to one or more Microsoft Office applications, as well as to Visual Studio. For more information, see How to: Create an Add-In.
Reference: http://msdn.microsoft.com/en-us/library/0fyc0azh.aspx
#1 和 #3 适用于 Windows 计算机,但直接来自 Microsoft VSTO 团队的 Geoff Darst,".Net 开发Platform 和 Visual Studio Tools For Office 仅适用于 Windows。” 您必须VBA 代码,以获取跨所有三个版本的功能。
如果您只想针对 Windows 环境,请确保针对 2007 版本的 Excel,因为我不认为为 Excel 2010 开发的解决方案向后兼容 Excel 2007。
#1 and #3 will work for Windows machines, but straight from Geoff Darst of Microsoft's VSTO team, "the .Net Development Platform and Visual Studio Tools For Office are Windows only." You'll have to code in VBA to get functionality across all three versions.
If you want to target just the Windows environment, make sure you target the 2007 version of Excel, as I don't believe solutions developed for Excel 2010 are backward compatible with Excel 2007.