Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Excel 12.0 Object Library not found in user PC

Posted on 2010-09-20
7
Medium Priority
?
1,116 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 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

604 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