Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

No references to Microsoft.Office.Interop Assemblies

Posted on 2011-10-05
6
Medium Priority
?
913 Views
Last Modified: 2013-12-16
I have a new VS2010 C# project and want to add a reference to Microsoft.Office.Interop.Excel.  Unfortunately it is not appearing in the list of references on the .Net tab when I go to add a reference.  In fact there are NO references to anything beginning Microsoft.Office at all.

After much searching I found what I thought was the answer.  I need to download and install the Microsoft Office 2010 Primary Interop Assemblies - Redistributable package which I duly did.  

Instuctions for installing says to simply Double-click the O2010pia.msi.

However, after doing this the references are still not appearing.  

It's like pulling teeth... Why is it so difficult? That's the not question I want answering:)

Your help in this matter would be gratefully appreciated.



0
Comment
Question by:bflow
6 Comments
 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36915579
Have you looked at COM tab?

Add Reference > Com Tab
0
 

Author Comment

by:bflow
ID: 36915663
Yes I have.

There are a few various Microsoft Office references but nothing with respect to Interop or Excel.
0
 
LVL 8

Accepted Solution

by:
jagrut_patel earned 2000 total points
ID: 36916237
See whether Office PIAs are available in the directory
C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 36916431
Instead of loosing your time with Office automation (wait for the deployment nightmare!), if you can afford it, you better switch to http://www.aspose.com/categories/.net-components/aspose.total-for-.net/default.aspx
0
 
LVL 40
ID: 36917571
When you reference something in the COM tab, the namespace and the name used in the tab usually do not match.

Simply reference Microsoft Excel in the COM tab, and you will get the whole Microsoft.Office.Interop.Excel namespace.

If this does not work, it means that the interops (they are intermediary files between .NET and Office) have not been installed on development computer. They are usually installed along with Office or Visual Studio, but since they are an option than can be activated/deactivated during the installation, maybe they have been skipped. In such a case, you can install them by going through the Excel Install/Uninstall options in Programs section of the Control Panel.
0
 

Author Comment

by:bflow
ID: 36922601
Emoreau: Thanks but no thanks.  This is supposed to be a one off quick fix so buying 3rd party tools is not an option.

James: As your solution suggested and by my previous searches, the interops are installed with Office or VS.  My searches concluded that I re-install any missing features from the Office Install disk.  I did this but was not happy with the options offered. There was no obvious check boxes to select or deselect features and the interopt options 'appeared' to have been installed. I still went through the process but it had no effect.

jagrut:  It was your comments that led me down the correct path in the end.  When I looked in the C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office folder there were NO sub folders.  So, with nothing to loose I reran the VS2010 install and lo and behold the 'Microsoft Office Developer tools' were not selected.  I selected the missing features and it all works now.

I can only think when I installed VS2010 I was being frugal as I was trying to get everything installed on a 40GB SSD drive on my laptop and didn't think I needed this feature.

Thanks all for your help.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question