Solved

Excel version problem in VB

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel - Save a copy of work book 13 89
vb6 connector to SQL Server 2 37
How to measure sizes and angles in scanned images ? 3 75
Passing a Text Box name to a Sub 6 99
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

840 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