简体   繁体   English

MS Office Visual Studio加载项,共享加载项和Excel 2010加载项有什么区别?

[英]What's the difference between an MS Office Visual Studio Add-in, Shared Add-in, and Excel 2010 Add-in?

I am using Visual Studio 2010 to create a new add-in for Excel. 我正在使用Visual Studio 2010为Excel创建新的加载项。 Ideally I would like it to work with Excel 2011 (Mac), 2010, and 2007. 理想情况下,我希望它可以与Excel 2011(Mac),2010和2007一起使用。

There are three template options to choose from when I start a new C# project. 启动新的C#项目时,有三个模板选项可供选择。

  • (Office) Excel 2010 Add-in (Office)Excel 2010加载项

  • (Extensibility) Visual Studio Add-in (可扩展性)Visual Studio外接程序

  • (Extensibility) Shared Add-in (可扩展性)共享加载项

What are the differences between these template choices? 这些模板选择之间有什么区别?

Thanks in advance. 提前致谢。

From MS. 来自MS。 As the name implies, you probably want to use shared add-in. 顾名思义,您可能要使用共享加载项。

  • Office Excel 2010 Add-in Office Excel 2010加载项

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. 为Excel 2007或Excel 2010创建应用程序级加载项。有关详细信息,请参阅《编程应用程序级加载项和Excel解决方案入门》。

  • (Extensibility) Visual Studio Add-in (可扩展性)Visual Studio外接程序

Visual Studio Add-ins add functionality to the Visual Studio and Visual Studio Macros environments. Visual Studio加载项将功能添加到Visual Studio和Visual Studio宏环境中。 For more information, see How to: Create an Add-In. 有关更多信息,请参见如何:创建外接程序。

  • (Extensibility) Shared Add-in (可扩展性)共享加载项

Shared Add-ins can add functionality to one or more Microsoft Office applications, as well as to Visual Studio. 共享加载项可以向一个或多个Microsoft Office应用程序以及Visual Studio添加功能。 For more information, see How to: Create an Add-In. 有关更多信息,请参见如何:创建外接程序。

Reference: http://msdn.microsoft.com/en-us/library/0fyc0azh.aspx 参考: http : //msdn.microsoft.com/en-us/library/0fyc0azh.aspx

#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." #1和#3将适用于Windows计算机,但直接来自Microsoft VSTO团队的Geoff Darst, “。Net开发平台和Office的Visual Studio工具仅是Windows。” You'll have to code in VBA to get functionality across all three versions. 您必须在VBA中编码才能获得所有三个版本的功能。

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. 如果只想针对Windows环境,请确保要针对Excel 2007版本,因为我不认为为Excel 2010开发的解决方案与Excel 2007向后兼容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM