none
Can't find Microsoft.Office.Interop.Excel.dll

    Question

  •  

    I am trying to use this namespace and downloaded the O2003pia.exe from http://support.microsoft.com/kb/897646.

     

    I ran the msi and see the Interop files in the GAC but when I try to 'Add a Reference' in VS2005, I do not see any of the Interop namespaces.

     

    I already had Office 2003 installed before I ran the above msi.

     

    What else am I doing wrong. Why aren't these included with VS2005 in the first place..............

     

    Please help,

     

    JJM

    Monday, October 01, 2007 9:42 PM

Answers

  • Hi JJJMonty,

    Actually, if you want to use this DLL, following these steps:

    1.       On the Project menu, click Add Reference.

    2.       On the COM tab, locate Microsoft Excel Object Library, and then click Select. In Visual Studio 2005, locate Microsoft Excel 11.0 Object Library on the COM tab.

    3.       Click OK in the Add References dialog box to accept your selections. If you are prompted to generate wrappers for the libraries that you selected, click “Yes”.

    Then you should be able to use this interop DLL, for more details, please visit Primary Interop Assemblies.

    Hope this helps!

    Thanks!

    Wednesday, October 03, 2007 7:54 AM

All replies

  • Hi JJJMonty,

    Actually, if you want to use this DLL, following these steps:

    1.       On the Project menu, click Add Reference.

    2.       On the COM tab, locate Microsoft Excel Object Library, and then click Select. In Visual Studio 2005, locate Microsoft Excel 11.0 Object Library on the COM tab.

    3.       Click OK in the Add References dialog box to accept your selections. If you are prompted to generate wrappers for the libraries that you selected, click “Yes”.

    Then you should be able to use this interop DLL, for more details, please visit Primary Interop Assemblies.

    Hope this helps!

    Thanks!

    Wednesday, October 03, 2007 7:54 AM
  • Hi Feng Chen,

    I m also facing the same problem, i have already added the microsoft.excel 11.0 reference then also it is not identifying the Microsoft.Office.Interop.Excel namespace.It is giving Microsoft.Office.core but not Microsoft.Office.Interop.Excel namespace.What should I do?

    Plz help.

     

    Friday, October 05, 2007 7:34 AM
  • By adding microsoft.excel reference in VS2005, You will find Interop.Excel & Microsoft.Office.core instead of Microsoft.Office.Interop.Excel.

    Tuesday, October 09, 2007 8:32 AM
  • I have a code that uses Microsoft.Office.Interop.Excel. I am using VS2005 and Office XP. When I added the reference to Microsoft Excel Object Library 10.0, it added Excel in the references but still I am not able to add this line on top of my code:

    using Microsoft.Office.Interop.Excel;

    When I press dot (.) after Microsoft.Office it just displays Core option. Why?
    Sunday, March 30, 2008 7:16 AM
  • yaa that was the problem with me also.

    until or unless we add Microsoft.Office.Interop.excel dll explicitely from reference it doesn't show that option.

    And this reference is available only with licensed version.It means when we hav licensed version for both .net and Microsoft office.

     

    Monday, March 31, 2008 5:46 AM
  •  

    Hi

     

    Try 

     

    the following 

     

    using Excel = Microsoft.Office.Interop.Excel;

     

    and use Excel

     

    it's working for me

     

    good luck

    Tuesday, April 01, 2008 1:12 AM
  • If you have to install the new Interop package from Microsoft, make sure you exit Visual Studio and re-open your project.  This should help.  It took me a couple of hours to figure this one out.

    Tuesday, May 20, 2008 5:25 PM
  •  Amazing...I was having the same issue, no matter what i referenced, I could not get the excel object on the page.
    I have never seen this being used "Imports Excel = Microsoft.office.interop.excel". Can someone explain why this works.
    • Edited by RobiSingh Thursday, November 13, 2008 2:08 PM
    Thursday, November 13, 2008 2:07 PM
  • My Easy Solution:

    1. Download and install pre op assemblies files from the microsoft site: 'OFFICE XP PIAs'

    2. I unzipped and save all files to a directory A in my local machine.

    3. There will be a file called register.bat in the directory A. simply double click that file.. register entries will automatically happen

    4. After unzipping the contents, i copied all the files from that directory 'A' to C:\Program Files\Microsoft.Net\Primary Interop Assemblies\    (you can overwrite the existing files .. no prob)

    5. In your visual studio IDE, click Add Reference.. go to tab '.NET'. Locate and click select 'Micrsoft Office Interop Excel'.

    6. Now you can use in your code ..    Imports Excel = Microsoft.Office.Interop.Excel

     

    Please tell if me if is worked. It worked for me!

     

     

    • Proposed as answer by ryu457 Thursday, May 13, 2010 4:53 AM
    Thursday, August 13, 2009 4:59 PM
  • I have done what you have told above but I cannot add a reference into Visual Studio IDE. I have copied all the files in the required location but still cannot use Microsoft.Office.Interop.Excel.

    Please guide me.

    • Proposed as answer by Arvin Monday, October 31, 2011 7:06 PM
    • Unproposed as answer by Arvin Monday, October 31, 2011 7:06 PM
    Friday, September 18, 2009 9:57 AM
  • What is the system tip?


    Nothing is impossible for a willing heart.
    Tuesday, November 10, 2009 3:19 PM
  • I just had this problem where in VS2008, when I try to "Add Reference...", and select Microsoft Excel 11.0 Object Library, the only namespace available is Microsoft.Office.Interop.Access.

    Solution: I went to the "Add Reference..." interface and looked at the ".Net" tab. All of the Microsoft.Office.Interop dlls were available including Microsoft.Office.Interop.Excel. Bottom line: I looked under the wrong tab.

    Hope this helps!

    Thursday, November 12, 2009 9:58 PM
  • Hi!

    I had the same problem. I have figured it out how to solve this problem. In my application I only needed the Microsoft.Office.Interop.Excel namespace. After unpacking the files from the Office XP PIA msi i copied the Microsoft.Office.Interop.Excel.dll, office.dll, stdole.dll to the Program Files\Microsoft.NET\Primary Interop Assemblies\ directory. Now I can add the reference to my project under the .NET tab.
    I hope this helps!

    ZeitGeist
    Thursday, December 03, 2009 10:22 AM
  • Though I am late here but was searching for help and got it :) Assistance at the right time ! Thanks anyhow

    http://www.capstonebpo.com http://www.seowonders.com http://www.moistdesigns.com http://www.mastercareprotectionandcleaning.com
    Friday, December 04, 2009 9:27 AM
  • I've been able to use Microsoft.Office.Interop.Excel by adding a reference as mentioned above, however when I create a workbook and do a 'save as' (even without any formatting) it only saves 16843 (16K) of rows. I'm using Excel 2003 and Excel Interop version 11 (even tried 12). It should run the full 65K rows if I need it. My result set is larger than 16K but not more than 65K rows.

    Anyone know why the object is limited in size?

    Here's an incomplete snippet of what I'm doing:


     

    Dim oXL As Microsoft.Office.Interop.Excel.Application

     

    Dim oYB As Microsoft.Office.Interop.Excel.Workbooks

     

    Dim oWB As Microsoft.Office.Interop.Excel.Workbook

     

    Dim oSheets As Microsoft.Office.Interop.Excel.Sheets

     

    Dim oSheet As Microsoft.Office.Interop.Excel.Worksheet

     

    Dim oRG As Microsoft.Office.Interop.Excel.Range


    oXL =

    New Microsoft.Office.Interop.Excel.Application

    oXL.Visible =

    False

    oYB = oXL.Workbooks

    oWB = oYB.Open(strMyFileNamePath + strMyFileName)

    oWB = oYB.Item(1)

    oSheets = oWB.Worksheets

    oSheet =

    CType(oSheets.Item(1), Microsoft.Office.Interop.Excel.Worksheet)

    oSheet.Name =

    "Sheet1"

    oWB.SaveAs(strMyFileNamePath.ToString() + strMyDestFileName.ToString() +

    Date.Now.ToString("yyyyMMddhhmmss") + ".xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlExcel7)

    oWB.Close()

    oXL.Quit()

    Wednesday, December 16, 2009 5:27 PM
  • Hi,

    on my machine Interop assembiles are located in

    'C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies'

    or in

    'C:\Program Files\Microsoft.NET\Primary Interop Assemblies' for x86 machines.

     

    But for Excel ASP.NET application, Microsoft discourages usage of Excel Interop :

    http://support.microsoft.com/kb/257757

    For creating xls, xlsx, ods, csv files in your web application I recommed you take a look at this Excel C#/VB.NET library.

    Thursday, April 08, 2010 8:18 AM
  • I simply added Excel by Add reference, and project worked which first gave issue about Excel using:

    using Excel = Microsoft.Office.Interop.Excel;

     

     

    Thursday, September 30, 2010 7:04 PM
  • Hi JJM,

     

    Alternatively, you can try this different direct download from microsoft:

    http://download.microsoft.com/download/c/4/8/c4813cc0-a4d4-4bb4-b486-9cbd56f38235/oxppia.exe

     

    Run the batch file to register them after you extract them to your chosen folder.

    Remember to click 'add reference'

    then locate the microsoft.office.interop.excel.dll file>open>hit OK

    You should now see the Excel object under 'references'.

     

    Choose the code view for the form then type:

    Imports Excel=Microsoft.Office.Interop

     

    Hope this solves your dll problem.

     

    Regards,

     

    Raven

    Sunday, October 10, 2010 7:49 AM
  • I have a suggestion for you, pvecchio99

    Near the bottom of your code sample, it says

    oWB.SaveAs(strMyFileNamePath.ToString() + strMyDestFileName.ToString() +
    Date.Now.ToString("yyyyMMddhhmmss") + ".xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlExcel7) 
    
    
    

    You should change the last paramater (Microsoft.Office.Interop.Excel.XlFileFormat.xlExcel7) to Microsoft.Office.Interop.Excel.XlFileFormat.xlExcel8.

    xlExcel7 is the Excel 95 format, which may not have supported all 65K rows. xlExcel8 is the Excel 97-2003 format, which does support all 65K rows.

    This should solve your problem.

    Saturday, December 11, 2010 8:12 PM
  • Great post! thanks, helped me a lot, as I experienced the same problem, and could not find anything useful on the topic.
    Sunday, April 10, 2011 4:33 PM
  • Hello

    My os is W7 famillial (64 bits)

    I use office 2010, and visual studio 2010 express C#

     

    I wanted to learn to make excel file, and fill it as I want using C# program

    In visual studio.

     

    I still get an error on the .excel on the two linesjust below

     

     

    using Microsoft.Office.Interop.excel;

    using Excel = Microsoft.Office.Interop.excel;

     

    despite I did what I describe  below

    I  have first downloaded on this site PIARedist.exe

    http://www.microsoft.com/download/en/confirmation.aspx?id=3508

    when I click on it, it has unzipped 3 files o2010pia_eula.txt, O2010pia.msi, o2010pia_readme.rtf

    I did open a command dos, went to the dir which contains O2010pia.msi

    I did execute msiexec.exe /I  O2010pia.msi

    And re-add reference Microsoft Excel 14.0 Object Library

    ·         1. On the Project menu, click Add Reference.

    2. On the COM tab, locate Microsoft Excel Object Library, and then click Select. In Visual Studio 2005, locate Microsoft Excel 11.0 Object Library on the COM tab.

    But I was not prompted to “generate wrappers” ( I don’t know what does it means !) like in the third step (below)

    3. Click OK in the Add References dialog box to accept your selections. If you are prompted to generate wrappers for the libraries that you selected, click “Yes”.

    Im feed up with this darn error ,Could anybody help me ?


    when i do a search on my computer with Microsoft.Office.Interop, it only find Microsoft.Office.Interop.word.dll, but not Microsoft.Office.Interop.excel.dll, i supose this is the problem !.


    with word i get no problem

    using Microsoft.Office.Interop.Word;

    using Word = Microsoft.Office.Interop.Word;

    no error it is ok

    web src C# excel tutorial: csharp.net-informations.com/excel/csharp-create-excel.htm
    • Edited by zozio Sunday, August 28, 2011 4:12 AM web src tuto
    Saturday, August 27, 2011 1:43 PM
  •  

    Hi after downloading and run the rejistry file on ur computer (if you want to keep your old Interop Assemblies files dont  overwrite them) just simply copy into another address . Go to the Project \Add Refference click on the "Browse" tab, locate the Microsoft.Office.Interop.Excel.dll and you can use it Right away.

    • Proposed as answer by C-Sharplearner Tuesday, January 31, 2012 8:23 PM
    Monday, October 31, 2011 7:11 PM
  • hello

    please,can you just read my message before giving a response.

    when i do a search on my computer withMicrosoft.Office.Interop, it only findMicrosoft.Office.Interop.word.dll, but not Microsoft.Office.Interop.excel.dll, i supose this is the problem !.

    Wednesday, November 02, 2011 5:00 AM
  • Hi Arvin, Thank you, that Browsing button was there and we never thought about it, Very efficient method, Thanks
    Tuesday, January 31, 2012 8:24 PM
  • Hi Arvin, Thank you, that Browsing button was there and we never thought about it, Very efficient method, Thanks

    where can  I find this F..  Microsoft.Office.Interop.excel.dll ??
    • Edited by zozio Saturday, February 04, 2012 11:30 AM
    Saturday, February 04, 2012 11:29 AM
  • Thanks!
    Wednesday, May 23, 2012 3:04 PM
  • We're updating an older vs2005/excel 2003 application and had to make a two-step fix in VS2010

    Add a reference by browsing:

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Microsoft.Office.Interop.Excel.dll

    Add a "named" using statement:

    using Excel = Microsoft.Office.Interop.Excel;

    Friday, July 20, 2012 4:30 PM
  • thanks ...it worked... in VST2010
    Friday, October 05, 2012 1:00 PM
  • I do not have a program files (x86). only a "program files".

    I cannot find the microsoft.office.interop.excel.dll file anywhere. I have a licensed version of office 2010 and also visual basic 2010 express on my computer. What do I need to do to get this interop function to work. I have tried everything I have seen on here so far. It just never shows up in my file structure or in the references. 

    I  am running Windows 7 32 bit.
    • Edited by GTCorey Tuesday, October 23, 2012 8:53 PM
    Tuesday, October 23, 2012 8:52 PM
  • Having the same problem I think. Any answers?
    Tuesday, October 23, 2012 8:55 PM
  • u save my time buddy!

    Nithi Govin

    Wednesday, October 31, 2012 5:06 PM
  • Microsoft.Office.Interop.Excel.Application app = new Microsoft.Office.Interop.Excel.Application();
    app.Visible = true;
    Microsoft.Office.Interop.Excel.Workbook wb = app.Workbooks.Add(1);
    Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets[1];

    listview to excel sample read more

    http://coder.digitaldunyam.net/listviewdeki-veriyi-excel-e-aktarma/


    • Edited by mcdmrt Tuesday, April 09, 2013 7:30 AM
    Tuesday, April 09, 2013 7:29 AM
  • Thanks, this really helped me find the Excel Object Library!
    Tuesday, May 07, 2013 7:45 PM