使用Excel COM Interop引用构建代码? [英] Building code using Excel COM Interop reference ?

查看:55
本文介绍了使用Excel COM Interop引用构建代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我刚刚将代码迁移到VSTS解决方案。一切都还可以,但有一点:Excel Interop引用没有构建。

I just migrated code to VSTS solution. All is ok but one thing : Excel Interop reference that is not building.

我有一个使用Excel互操作的项目(因此它有一些Microsoft.Office使用和Microsoft.Office.Core和Microsoft.Office.Interop.Excel引用)。

I have a project that uses Excel interop (so it has some Microsoft.Office usings and a Microsoft.Office.Core and Microsoft.Office.Interop.Excel reference).

构建说  错误CS0234:类型或命名空间名称'Office'不存在于名称空间"Microsoft"中(您是否缺少程序集引用?)

The build says Error CS0234: The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

有没有办法让它构建拜托?

谢谢

Steeve

推荐答案

谢谢你联系Microsoft论坛。我们很乐意回答您的问题。

Thank you for contacting Microsoft forums. We are pleased to answer your query.

我会请求您尝试这种可能对您有用的解决方法:

I would request you to try this workaround which might help you:


  • 解决方案资源管理器中,右键单击项目名称,然后单击
    添加参考。将出现"添加引用"对话框。
  • 在"程序集"页面上,选择"组件名称"列表中的 Microsoft.Office.Interop.Excel
  • In Solution Explorer, right-click your project's name and then click Add Reference. The Add Reference dialog box appears.
  • On the Assemblies page, select Microsoft.Office.Interop.Excel in the Component Name list

如果没有看到装配体,可能需要确保它们已安装并显示
单击"确定"

If you do not see the assemblies, you may need to ensure they are installed and displayed Click OK.

此外,您需要安装
构建服务器上的Microsoft Office 2010主互操作程序集(PIA) 
,作为Microsoft Windows Installer程序包,包含Microsoft Office 2010产品的主互操作程序集。

Also, you need to install the Microsoft Office 2010 Primary Interop Assemblies (PIA) on the build server as Microsoft Windows Installer package contains the Primary Interop Assemblies for Microsoft Office 2010 products.

我希望答复将帮助您解决您的疑问。如果您需要进一步的帮助,请回复该主题,因为我们随时可以提供您的查询。

I hope that the reply will assist you in getting your query addressed. In case you require further assistance, please do reply to the thread as we are always available to your queries.

问候,

_____________________________________________________________________________________

_____________________________________________________________________________________

如果帖子回答了您的问题,请点击 该帖子标记为答案   投票赞成

If a post answers your question, please click Mark as Answer on that post and Vote as Helpful

这篇关于使用Excel COM Interop引用构建代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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