Solved

MS Excel 12.0 Object Library not found in user PC

Posted on 2010-09-20
7
1,069 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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 85
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

691 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