做什么参考我需要使用的Microsoft.Office.Interop.Excel在.NET? [英] What reference do I need to use Microsoft.Office.Interop.Excel in .NET?

查看:267
本文介绍了做什么参考我需要使用的Microsoft.Office.Interop.Excel在.NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感兴趣的使用C#来操作/自动化Excel文件。

I am interested in using C# to manipulate/Automate Excel files.

浏览我已经找到了网络后 VSTO 但似乎你不能使用在Visual Studio防爆preSS版,所以我不能使用。

After browsing the web I have found VSTO but it seems you can not use that in Visual Studio Express Edition so I can not use that.

就在几分钟前,我注意到,在这个网站中使用此命名空间中的code的一个问题:

Just few minutes ago I noticed a question in this site that used this namespace in its code:

的Microsoft.Office.Interop.Excel

所以,我想知道如果我需要使用的是添加必要的参考,如果是其中提到补充?

So I am wondering if all I need to use that is add necessary reference and if so which reference to add?

更新

我安装主互操作程序集作为公认的答案建议,但出于某种原因,他们仍然在.NET添加引用对话框中失踪,但他们是present GAC中。

I installed "Primary Interop Assemblies" as the accepted answer suggested but for some reason they are still missing in the Add Reference dialog under ".NET" but they are present in GAC.

所以,我只是说使用浏览,位于 Microsoft.Office.Interop.Excel.dll 在GAC文件夹中的参考。

So I just added the reference using "Browse" and located Microsoft.Office.Interop.Excel.dll in GAC folder.

不过找本网站有关添加引用来自海关总署看来这是不建议类似的问题。

But looking for similar questions on this site regarding adding reference from GAC it seems this is not recommended.

推荐答案

这些都可以作为主互操作程序集,它可以与Office分开安装,或者下载并安装。 如何:安装Office主互操作程序集

These are available as "Primary Interop Assemblies", which can be installed with Office, or downloaded and installed separately. How to: Install Office Primary Interop Assemblies.

一旦这些被安装,你可以参考他们在Add Reference对话框中你的项目,在.NET。如果没有看到这些Microsoft.Office.Interop组件上市,那么它们尚未安装。从您的设置进行安装,或者单独下载并安装它们(见上面我的链接进行下载)。

Once those are installed, you can reference them in your project in the Add Reference dialog, under .NET. If you do not see those Microsoft.Office.Interop assemblies listed, then they have not been installed yet. Install them from your setup, or download and install them separately (see my link above for the downloads).

这篇关于做什么参考我需要使用的Microsoft.Office.Interop.Excel在.NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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