Solved

MS Excel 12.0 Object Library not found in user PC

Posted on 2010-09-20
7
1,034 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
7 Comments
 
LVL 69

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 69

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now