[英]Compatibility between MS Office Excel 2007 & 2010 Add in
I'd like to know if there's any way to develop, in example, an Excel add in for office 2007 that will work on office 2010? 我想知道是否有任何方法可以开发,例如,Office 2010可以在Office 2010上使用Excel? (Or a 2010 add in on 2007)
(或2010年加入2007年)
How should I do that? 我该怎么办? Have you got some examples / sources?
你有一些例子/来源吗?
Have a look at this MSDN article Running Solutions in Different Versions of Microsoft Office 看看这篇MSDN文章在不同版本的Microsoft Office中运行解决方案
Basically what Microsoft say is that this is possible PROVIDED the features you use in your add-in work in both 2007 and 2010 versions of your office program(in your case Excel) 基本上微软所说的是,这可以提供你在2007和2010版本的办公程序中使用的加载项工作的功能(在你的情况下是Excel)
I'm not sure as to the scale of the project you're trying to build but from personal experience I always had to create two separate versions of the add-in to target 2007 and 2010 versions of Office 我不确定您要构建的项目的规模,但从个人经验来看,我总是必须为目标2007和2010版本的Office创建两个独立版本的加载项
Just found out that you can get the Version number from the Application object. 刚刚发现您可以从Application对象获取版本号。 I haven't had time to play around with this but I assume that you can use below in cases where the 2010 code is incompatible with 2007 and execute code for the appropriate version:
我没有时间玩这个,但我假设您可以在2010年代码与2007不兼容的情况下使用以下内容并执行相应版本的代码:
Microsoft.Office.Interop.Excel.Application app = Globals.ThisAddIn.Application;
string version = app.Version;
if (version == "14.0")
{
//If Excel 2010 do something
}
else if (version == "12.0")
{
//If Excel 2007 do something else
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.