Solved

Excel version problem in VB

Posted on 2003-11-13
6
155 Views
Last Modified: 2010-05-01
I used the following code in VB for saving an excel sheet in a machine having Excel Version 10.0.
xl.ActiveWorkbook.SaveAs gProject.UserFolder & "\graphtmp.xls"
But I cannot use the dll of this project in a machine having Excel Version 9.0.When it reaches the above code, the program is being stuck.IF the dll is being created in the same machine having Excel version 9.0.,there isn't any problem.How can I solve this problem?
0
Comment
Question by:123rrr
6 Comments
 
LVL 9

Accepted Solution

by:
p_sie earned 23 total points
ID: 9739024
Always make a reference to the lowest version of office. This is, because when there is a higher version of office available
it automatically takes that version, but it cannot take an older version.

A way add the office 9 version to the xp-machine is:

copy to a new folder: excel9.olb and msword9.old and mso9.dll to the Machine having version 10.
Then start your VB project and set the references to the version 9 objects of office. Remember to first
set te office 10 versions off, then close the reference form, open the reference form and click on browse...
select the correct filetype and navigate to the *.olb or *.dll file you want.

This should solve your problem

Good luck
0
 
LVL 26

Assisted Solution

by:EDDYKT
EDDYKT earned 22 total points
ID: 9739048
What's the error,

You can use late bound

ie

dim xl as object
0
 
LVL 11

Expert Comment

by:Steiner
ID: 9739449
Adding to EDDYKT-Comment:
Remove the reference to the Excel Library in your project references, too.

And be warned, you won't be able to use constants from this library. So you'll have to replace constants beginning with xl with their real values.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10548245
Moderator, my recommended disposition is:

    Split points between: p_sie & EDDYKT

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

932 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

16 Experts available now in Live!

Get 1:1 Help Now