none
** Microsoft.Office.Interop.Excel.dll - Do I need Excel installed?? **

    Question

  • Hi,

    I have a VB.Net app which creates an Excel report.  This is all working fine on my development box
    which turns out to have MS Office 2003 installed.  The app works fine.  I added a reference to
    Microsoft Excel 11.0 Object Library under the COM tab when I did the "Add Reference".  I also copied
    the Interop.Excel.dll to my BIN folder.

    The server that I need to deploy my app to does not have MS Office or Excel installed.  I ran the app
    anyway just to see if it would worked.  Of course, it failed with this error:

    Retrieving the COM class factory for component with CLSID {00020820-0000-0000-C000-000000000046} failed due to the follo
    wing error: 80040154.

    Do I need to have Excel installed on the target machine?  I took a copy of "Microsoft.Office.Interop.Excel.dll"
    from the GAC on the DEV box and installed on the GAC on the target machine.  Tried the app again and still
    failed with the same error.  I really don't want to install Excel if I don't have to.  Can someone please provide
    some help on this?

    Thank you in advance!




    Tuesday, January 19, 2010 4:27 PM

Answers

  • Unfortunately you need to have Microsoft Excel installed in order to have access to the Introp libraries that you need to add as references to your project in order to make it work.

    • Marked as answer by YiChun Chen Wednesday, January 27, 2010 2:30 AM
    Wednesday, January 20, 2010 12:51 PM
  • Thank you for GNS1's kindly help.

    Hi Sydney2000,

    Thank you for your post.

    I agree with GNS1.

    To obtain the reference to interop with excel in your program, you have to first install Excel and then install the PIA of excel.
    For more information on PIA, please see: http://msdn.microsoft.com/en-us/library/15s06t57.aspx and http://msdn.microsoft.com/en-us/library/aa159923(office.11).aspx.

    For similar issue, please refer to: http://social.msdn.microsoft.com/Forums/en/vssetup/thread/afe35d78-ec74-457f-b8f0-d8c36d02c250

    Hope this helps! If you have any concern, please feel free to let me know.

    Have a great weekend.

    Best regards,
    Yichun Chen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by YiChun Chen Wednesday, January 27, 2010 2:30 AM
    Thursday, January 21, 2010 6:15 AM
  • Hi Sydney2000,

    Thank you for your reply and sorry for delay.

    To use the features of a Microsoft Office application, we need to use the primary interop assembly (PIA) for the application. The primary interop assembly enables managed code to interact with a Microsoft Office application's COM-based object model.
    To apply PIA that can obtain the reference to interop with excel in your program, you have to install Excel.

    Hope this helps! If you have any concern, please feel free to let me know.

    Best regards,
    Yichun Chen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by YiChun Chen Wednesday, January 27, 2010 2:30 AM
    Monday, January 25, 2010 8:49 AM

All replies

  • Unfortunately you need to have Microsoft Excel installed in order to have access to the Introp libraries that you need to add as references to your project in order to make it work.

    • Marked as answer by YiChun Chen Wednesday, January 27, 2010 2:30 AM
    Wednesday, January 20, 2010 12:51 PM
  • Thank you for GNS1's kindly help.

    Hi Sydney2000,

    Thank you for your post.

    I agree with GNS1.

    To obtain the reference to interop with excel in your program, you have to first install Excel and then install the PIA of excel.
    For more information on PIA, please see: http://msdn.microsoft.com/en-us/library/15s06t57.aspx and http://msdn.microsoft.com/en-us/library/aa159923(office.11).aspx.

    For similar issue, please refer to: http://social.msdn.microsoft.com/Forums/en/vssetup/thread/afe35d78-ec74-457f-b8f0-d8c36d02c250

    Hope this helps! If you have any concern, please feel free to let me know.

    Have a great weekend.

    Best regards,
    Yichun Chen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by YiChun Chen Wednesday, January 27, 2010 2:30 AM
    Thursday, January 21, 2010 6:15 AM
  • Thanks for the replies.

    What's the purpose of installing PIA?  I thought having the Excel application would suffice the need

    for programmatically creating an Excel file using VB.NET.

    On the DEV box, we did not explicitly install PIA unless it came with other Microsoft installls.

    Thank you.
    Sydney

    Thursday, January 21, 2010 2:48 PM
  • Hi Sydney2000,

    Thank you for your reply and sorry for delay.

    To use the features of a Microsoft Office application, we need to use the primary interop assembly (PIA) for the application. The primary interop assembly enables managed code to interact with a Microsoft Office application's COM-based object model.
    To apply PIA that can obtain the reference to interop with excel in your program, you have to install Excel.

    Hope this helps! If you have any concern, please feel free to let me know.

    Best regards,
    Yichun Chen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by YiChun Chen Wednesday, January 27, 2010 2:30 AM
    Monday, January 25, 2010 8:49 AM
  • If you want to read, write excel file, with out Ms-Office installed on the server, then you can go ahead with below URLs.

    http://www.e-iceblue.com/Introduce/excel-for-net-introduce.html

     It is a c# excel component that supports importing/exporting to XLS, XLSX, CSV and HTML files.

    Thursday, August 12, 2010 6:31 AM
  • try the following link , its useful

    http://vb.net-informations.com/excel-2007/vb.net_excel_2007_tutorials.htm

     

    gever.

     

    Tuesday, December 28, 2010 11:53 AM
  • Could you clarify if you need to have Excel installed on the development machine, the clients machine, or both? I am developing on a machine with Excel using the Microsoft.Office.Interop.Excel.dll library and am finding that if I deploy my application to a machine that has no Excel at all, or a 'Limited Edition' version of Excel, then it crashes with the same error code the OP mentioned.

    So are you talking about having Excel installed on the dev machine or on the client/target machine?

     

    Thanks,
    David

     

    Tuesday, November 22, 2011 10:07 PM
  • Hi, I come from google, your excel component do not need MS, but I wonder can it save as XML or other formats as MS does?

    Please answer me! Thanks!

    Tuesday, July 10, 2012 9:39 AM
  • Hi David, you need to have MS Excel installed on both machines, client and server, so that you can work with Excel Interop in development and in deployment.

    If you are not able to have MS Excel on both machines then I would recommend you to try this .NET Excel component which has no dependency on MS Excel.

    Also to Michelle, this component will enable you to save Excel file in .NET in various output formats and in the same manner (really straightforward API).


    • Edited by E. Crawford Thursday, September 26, 2013 8:20 AM Removing o:p tags
    Thursday, September 26, 2013 8:20 AM