vb.net 我在哪里可以找到程序集/COM 浏览器窗口中的“microsoft.office.interop.excel”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21817898/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 16:46:50  来源:igfitidea点击:

Where can I find "microsoft.office.interop.excel" in the Assembly / COM browser window?

vb.netvisual-studio-2012referenceideproject

提问by tmighty

I wanted to add the reference microsoft.office.interop.excelto my project.

我想添加microsoft.office.interop.excel对我的项目的引用。

I went to Project > Properties > References > and clicked the Add...button.

我转到“项目”>“属性”>“引用”> 并单击Add...按钮。

In the Reference Managerdialog, I have the following options:

Reference Manager对话框中,我有以下选项:

  • Assemblies
  • Frameworks
  • Project folder
  • COM
  • Search
  • 组件
  • 构架
  • 项目文件夹
  • 通讯
  • 搜索

There is a search window. I typed microsoft.office.interop.excel, but it is just not found.

有一个搜索窗口。我输入了microsoft.office.interop.excel,但就是找不到。

I had to browse for it to locate it manually on my drive.

我必须浏览它才能在我的驱动器上手动找到它。

Why?

为什么?

回答by ?s??? ????

Project menu> Add Reference. On the COM tab, locate Microsoft Excel 15.0 Object Library

Project menu> Add Reference. 在 COM 选项卡上,找到Microsoft Excel 15.0 Object Library

That's the reference which contains Microsoft.Office.Interop.Excel.dll

这是包含的参考 Microsoft.Office.Interop.Excel.dll

If you are prompted to generate wrappers for the libraries that you selected, click Yes.

如果系统提示您为所选库生成包装器,请单击Yes

回答by STLDev

You should see it in the Visual Studio Reference Manager Window when you select COM. Look for Microsoft Excel 14.0 Object Library(or the version you have installed). If you don't see it, it needs to be re-registered. The easiest way to do this is to just re-run it's installation.

当您选择COM. 查找Microsoft Excel 14.0 Object Library(或您已安装的版本)。如果没有看到,则需要重新注册。最简单的方法是重新运行它的安装。

To re-install it, find the Primary Interop Assembly executable on your drive download it from Microsoft. Search for "Office Primary Interop Assembly". After downloading, run the executable to extract the msifile for the PIA. Run the msifile to complete the installation.

要重新安装它,请在您的驱动器上找到 Primary Interop Assembly 可执行文件,从 Microsoft 下载它。搜索“Office 主要互操作程序集”。下载后,运行可执行文件以提取msiPIA 文件。运行该msi文件以完成安装。