Solved

Using of MS Office 97 and Office 2000

Posted on 2001-08-02
16
179 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…
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…

803 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