Solved

Excel version problem in VB

Posted on 2003-11-13
6
156 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 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