• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Using of MS Office 97 and Office 2000

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
asmahmood
Asked:
asmahmood
  • 7
  • 5
  • 3
  • +1
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Declare all the office variables AS OBJECT...
all the SET = NEW Excel.Appliation need to be
SET = CREATEOBJECT("Excel.Application")

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

Cheers
0
 
WolfgangKoenigCommented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
asmahmoodAuthor Commented:
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
 
TimCotteeHead of Software ServicesCommented:
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
 
asmahmoodAuthor Commented:
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
 
WolfgangKoenigCommented:
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
 
WolfgangKoenigCommented:
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
 
WolfgangKoenigCommented:
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
 
asmahmoodAuthor Commented:
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
 
WolfgangKoenigCommented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
WolfgangKoenigCommented:
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
 
asmahmoodAuthor Commented:
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
 
asmahmoodAuthor Commented:
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
 
WolfgangKoenigCommented:
You're welcome
WoK
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 7
  • 5
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now