No references to Microsoft.Office.Interop Assemblies

Posted on 2011-10-05
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.

Question by:bflow
    LVL 17

    Expert Comment

    Have you looked at COM tab?

    Add Reference > Com Tab

    Author Comment

    Yes I have.

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

    Accepted Solution

    See whether Office PIAs are available in the directory
    C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14
    LVL 69

    Expert Comment

    by:Éric Moreau
    Instead of loosing your time with Office automation (wait for the deployment nightmare!), if you can afford it, you better switch to
    LVL 40

    Expert Comment

    by:Jacques Bourgeois (James Burger)
    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.

    Author Comment

    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.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    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.…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now