Solved

Using of MS Office 97 and Office 2000

Posted on 2001-08-02
16
173 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
  • 7
  • 5
  • 3
  • +1
16 Comments
 
LVL 142

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 142

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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 142

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

757 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

19 Experts available now in Live!

Get 1:1 Help Now