Solved

Using of MS Office 97 and Office 2000

Posted on 2001-08-02
16
188 Views
Last Modified: 2010-05-02
I develop a program in vb which make some files of word and Excel 2000 but some of my users are using office 97 and this program did'nt work on their systems as it did'nt find refered dll of office 2000. Is their any way that i make programme having only office 2000 on my systems(I cannt use office 2000 due to some access databases and neither want to) and adding its refrence and my user use it having 0ffice 97 on their system.
0
Comment
Question by:asmahmood
[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
  • 7
  • 5
  • 3
  • +1
16 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6343984
Declare all the office variables AS OBJECT...
all the SET = NEW Excel.Appliation need to be
SET = CREATEOBJECT("Excel.Application")

Cheers
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6344010
Declare all the office variables AS OBJECT...
all the SET = NEW Excel.Appliation need to be
SET = CREATEOBJECT("Excel.Application")

Cheers
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6344089
You can reference to the type libs of Excel and Word but you must use the oldest of them. In your case it would the Office 97 (word8.olb;excel8.olb) one.

Office2000 is backward compatible to Office97 and this is the reason why you can go this way.

;O)
WoK
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:asmahmood
ID: 6344180
I didn't had the reference (word8.olb;excel8.olb) because i didn't install office 97 but 2000 and so i have word9/excel9 in refrence and my some user got office 97 which is not forward compatible.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6344255
Then go with angelIII's solution. Defining the objects as Object will allow late binding using CreateObject and will then use whichever object model is available, providing that you do not use features in the excel 2000 object model that are not available in excel 97.
0
 

Author Comment

by:asmahmood
ID: 6344268
I am already checking all answers but it is a little bit time consuming because i have to check it on diffrent users.so cann't say about this untill i completely check every solution.
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6344451
You can simply recompile your vb project at system were office97 is installed.
Office97 is not forward compatible right, but Office 2000
(word9.olb ...) is backward compatible to Office97 (and also work8.olb).

Microsoft has recommended this way i described above.

WoK

0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6344463
You can also try to copy only the *8.olb which are located in:
Programs/MSOffice/Office

But i don't know if it works without an complete installation of Office97 at your WIN2000 system.

;)WoK
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6344485
With the using if late binding you must redefine all classes and types that are defined over the reference to the *9.olb's.
Another disadvantage is that you can only create some main classes directly with CreateObject for instance in excel:
"Excel.Sheet"
"Excel.Chart"
"Excel.Application"

...
WoK
0
 

Author Comment

by:asmahmood
ID: 6347303
We didn't have vb installed on office97 systems so i cannt compile it on those systems.
Guys i gave u an example and a tip which can stat that what kind of answer i am requiring.
Problem:
We often have the latest software, while their customers may use an older version. Microsoft Windows 2000 comes with Microsoft Data Access Components (MDAC) version 2.5 installed. who use Windows 2000 and who want to install their application on systems that are running versions of MDAC prior to version 2.5 cannot develop their application by using the latest Msado15.dll file.

On MDAC version 2.5 or later systems, Microsoft Visual Basic programmers who add a reference to Msado15.dll, create images that will not run on systems that are running an earlier version of MDAC (for example MDAC version 2.1 GA). Any attempt to run an image that was developed on MDAC version 2.5 or later on a earlier-version system produces an error message similar to the following:
Run time error '430': Class does not support Automation or does not support expected interface

Solution:
These errors are caused by new ActiveX Data Objects (ADO) interfaces that are referenced in the ADO 2.5 or later-produced image and that are not found in the Msado15.dll file on the target system.

To prevent this problem, Visual Basic programmers should reference the Msado20.tlb file;
Now i want some solution of this kind or if any one can give more simple idea.
0
 
LVL 4

Accepted Solution

by:
WolfgangKoenig earned 200 total points
ID: 6348036
There are three ways you can go:

First)
Use the oldest version of all components (MDAC and Office) that your customers have on their systems. Therefore you must use "msado20.tlb" and "*8.olb" in your development environment.
(method early binding)

Second)
Use the newest version of all components.
That requires that you distribute the newest version to your customers.
(method early binding)

Thrird)
Use late binding. Therefor all class vars must be declared as 'object' and defined by the CreateObject statement. This is version independent but difficult to program.
The reason for this is that i don't know if an method or
property exists later at runtime.

For larger development projects i would prefer the first or second method.

Hope this was helpfully
Best regards
WoK


0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6348057
I have to add a comment on your suggestions, WoK:
Don't forget that by different versions (of Office), some functionality has been added/changed. Thus for really large projects, i rather put the Office application management into a separate DLL, and hide all this binding into this DLL. The customer/use using Office97 will get the DLL working with Office97, the user with Office2k will get the DLL working with Office2k.

Cheers
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6348529
Yeah, thats right thats is a fourth solution is to provide an adaption for each office backend ...
This is needed when you use special or newer functions that an older Office don't support.

;>) WoK
0
 

Author Comment

by:asmahmood
ID: 6378609
I have another better solution with which i didn't have to add any refrence and that is vb's own file handling i use refrences because i use Excel templates but i now have decided to make templates at run time. And that thing didn't require any refrence of office so it dos'nt matter if user have office 2000/97 or even XP(we are planning to purchase it also).
What did u say guys how this simple idea is because i still did'nt check this thing on user's machines.
0
 

Author Comment

by:asmahmood
ID: 6396562
The answer is not exactly the thing i want but it show me a new way so i am acceptin it Thanks and congralation WoK
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6396584
You're welcome
WoK
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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

734 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