Solved

Excel version problem in VB

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

623 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