问题
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