确定 Excel 2007 插件与 excel 2010 插件 [英] Determine Excel 2007 addin vs excel 2010 addin

查看:35
本文介绍了确定 Excel 2007 插件与 excel 2010 插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了一个在 VS2010 中构建的 MS Excel 插件项目.如何确定是 Excel 2007 插件还是 Excel 2010 插件项目?

I have received a MS Excel addin project build in VS2010. How do I determine whether it is Excel 2007 addin or Excel 2010 addin project ?

推荐答案

从技术上讲,Mitja 的回答是正确的.在实践中,这并不完全准确.据我所知,这只能通过在 Excel 2007 和 2010 中运行加载项来检查.很可能,它在两种情况下都可以使用.检查 Microsoft.Office.Interop.Excel 程序集的版本没有帮助,因为 Microsoft.Office.Interop.Excel 12.0 在 Excel 2007 和 2010(甚至 2013)和 Microsoft.Office.Interop.Excel 14.0 中也能正常工作.在大多数情况下,加载项本身在所有三个版本的 Excel(2007、2010 和 2013)中也同样有效唯一的显着区别 - 在调试时运行的 Excel 版本 - 您可以在 .сsproj - 文件中看到:

Technically, the answer of Mitja is correct. In practice, this is not entirely accurate. As far as I know, this can only be checked by running add-in in Excel 2007 and 2010. Most likely, it will work in both cases. Checking of the version of Microsoft.Office.Interop.Excel assembly does not help, as Microsoft.Office.Interop.Excel 12.0 works fine in Excel 2007 and 2010 (and even 2013) and Microsoft.Office.Interop.Excel 14.0 - too. In most cases, the add-in itself will also work equally in all three versions of Excel (2007, 2010 & 2013) The only significant difference - a version of Excel that runs when debugging - you can see in your .сsproj - file:

  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties [...] OfficeVersion="12.0" [...] DebugInfoExeName="#Software\Microsoft\Office\12.0\Excel\InstallRoot\Path#excel.exe" />
      </FlavorProperties>
      [...]
    </VisualStudio>
  </ProjectExtensions>

这篇关于确定 Excel 2007 插件与 excel 2010 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆