Solved

MS Excel 12.0 Object Library not found in user PC

Posted on 2010-09-20
7
1,057 Views
Last Modified: 2012-05-10
Situation:
I have a program developed in Visual Studio 2005.  I have MS office 2007 installed in my XP computer, and I add reference to MS Excel 12.0 Object Library.
The program runs fine at my computer, however an error message pops up on users PC, which has MS office 2003 only.  The error message states MS Excel 12.0.0.0 Object Library is not found.

Question:
Is there anyway to work around this?
I did some research and some ppl talked about detecting the assembly and add the reference at runtime.  Is there any code for reference?
0
Comment
Question by:mishelper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 500 total points
ID: 33714846
you can go late bound (no reference in your application, everything declare as object).
you can also (what I prefer) use a 3rd party components like http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
0
 
LVL 18

Expert Comment

by:Cluskitt
ID: 33714851
On computers where you have excel 2003, open them and add the Excel 11 reference instead. It should work, unless you're using any function that was added for 2007 only.
0
 

Author Comment

by:mishelper
ID: 33715177
Thank you emoreau, is there any sample code you can share?

Than you Cluskitt, I cannot compile the program with your suggested way.  Visual Studio doesn't allow me to declare Excel objects as the reference is not found at my PC (developer PC)... I just cannot compile.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:Cluskitt
ID: 33715210
Yes, I know. I didn't read your question right, my bad. :P

As for code, see here to explain differences between late and early binding: http://www.dicks-clicks.com/excel/olBinding.htm
0
 
LVL 84
ID: 33715293
<No points wanted>

If you must support users with Excel 11.0, then you must either (a) do as emoreau suggests and use Late Binding or (b) do your final build on a machine that is representative of the minimum supported environment (i.e. a machine with Excel 11.0 installed). Option (a) is the preferred method.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 33715399
0
 
LVL 41

Expert Comment

by:graye
ID: 33717245
Or you could just deploy the Office 2007  Primary Interop Assemblies (PIA) along with your application.   That will put the missing Excel 12.0 Object Library on the PC
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=59daebaa-bed4-4282-a28c-b864d8bfa513&displaylang=en 
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

749 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