Solved

Excel version problem in VB

Posted on 2003-11-13
6
154 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
Comment Utility
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
Comment Utility
What's the error,

You can use late bound

ie

dim xl as object
0
 
LVL 11

Expert Comment

by:Steiner
Comment Utility
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
Comment Utility
Moderator, my recommended disposition is:

    Split points between: p_sie & EDDYKT

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA to format 3 77
VBS file using code from 2nd file (txt or vbs) 4 24
vb6 connector to SQL Server 2 32
vb6 connector to mongodb 2 25
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

771 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

12 Experts available now in Live!

Get 1:1 Help Now