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

徘徊边缘 提交于 2019-12-12 23:35:44

问题


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

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

In the Reference Manager dialog, I have the following options:

  • Assemblies
  • Frameworks
  • Project folder
  • COM
  • Search

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

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

Why?


回答1:


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

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

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




回答2:


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.

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 msi file for the PIA. Run the msi file to complete the installation.



来源:https://stackoverflow.com/questions/21817898/where-can-i-find-microsoft-office-interop-excel-in-the-assembly-com-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!