.NET Framework Developer Center > .NET Development Forums > .NET Base Class Library > Excel COM Object Liberary Reference Problem
Ask a questionAsk a question
 

AnswerExcel COM Object Liberary Reference Problem

  • Tuesday, November 03, 2009 6:38 AMAkif_P Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Friends,
       I am using Excel 12.0 Object Library in my VB .NET project to generate Excel Reports (Note: I am using Microsoft Office 2007-12.0 Object Library).

       It runs fine on my computer, but my application is giving a run-time error on client's computer having earlier versions of Microsoft Office (XP, 2000 etc.)

       Please help me to solve this problem.

    Thnx,
    -+ Akif

Answers

All Replies

  • Tuesday, November 03, 2009 7:16 AMJohnWein Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Develop on the Office 200 computer, reference the Office 9.0 libraries and set Copy Local to true.  Your app will then work with versions 9.0 and later.  Your app will work with the version you reference and later, but not earlier.  Thus, Office 12.0 references will only work with Office 12.0.  Also, with versions later than 9.0, you have to use the PIA's.
  • Tuesday, November 03, 2009 12:59 PMJialiang Ge [MSFT]MSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello

    Please refer to this KB article about writing Automation clients for multiple Office versions
    http://support.microsoft.com/default.aspx/kb/244167
    You need to reference the type library of the earliest version of the Office application you intend to Automate.
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    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.
  • Monday, November 09, 2009 7:37 AMeryangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Akif,
    It is a long time since the last reply, are those replies helpful for you? It will be very beneficial for other community members having the similar questions if  you mark useful replies as answers.

    Thansk,
    Eric
    Please remember to mark helpful replies as answers and unmark them if they provide no help.
  • Monday, November 09, 2009 9:33 AMAkif_P Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thxn frnds,
    Late Binding concept helped me a lot. Thnx again.

    Akif