Solved

Missing reference ocx in excel although present

Posted on 2004-04-09
8
270 Views
Last Modified: 2013-12-26
We developped an ActiveX component in VB 6 to be used in Excel (2000 and XP). It gets some data from a small server component and puts it in a worksheet. This OCX gets installed onto Win2000 and WinXp machines.

The problem:

If I install the OCX onto machine x, y ,z it works fine, if I install the OCX onto machine a, b, c and open the same Excel sheet that I use on machine x, y, z (over the network) they are no longer working (the ocx object can be seen on the Xl sheet but Xl seems to look at it as where it a picturebox). I found that Excel reports the reference to this OCX 'MISSING' although I just installed it.

At this point the only option I have to get this sheet to work is to totaly recreate the workbook, put the OCX in there and save it. When this is done the workbook works on ALL the machines (a, b, c, x, y, z).

I think the only way to solve this issue is to try to understand how Excel saves the OCX information to the file. Or maybe someone can explain to me if there are some options that I need to set in my VB 6 project to prevent these problems.

Main question is: How is this possible and how do I prevent this from happening?
0
Comment
Question by:storkpmtbox
  • 3
  • 3
8 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 10792268
The Excel object you reference in your VB project is directly related to the Excel that is installed on your machine. Example: if you have Excel XP installed on your machine then the Excel library that will be flashed will be 10. However, if you try to run the VB project file on a machine that has another Excel version installed you will see that error, becuase VB tries to look for 10.0 version of Excel.
0
 

Author Comment

by:storkpmtbox
ID: 10811013
Sorry for not being clear,

The OCX is reported missing IN Excel. I am referencing an (self made) object from Excel. I am NOT referencing an Excel object from my VB project.

One thing that would help me to debug the problem is some kind of tool to look inside the Excel sheet and see how my OCX is referenced (which CLSID's etc.) and some tool to see how my OCX is registered on a particular PC.
0
 
LVL 18

Expert Comment

by:Sethi
ID: 10811129
I am not sure how to do this but this is what I can see: Go to Add Ins and pres Automation...see if something there helps.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:storkpmtbox
ID: 10811606
This option is only available in Excel XP and newer not in Excel 2000.

But I fail to see the point on looking at a list of available components on a PC because the ActiveX component that I am using IS available, Excel just does not seem to be able to find that object although it is listed! Like I said it probably has something to do with CLSID's and perhaps version numbers but I can not check this because I can not look inside the Xl sheet.
0
 
LVL 18

Expert Comment

by:Sethi
ID: 10811821
That's what I told you. I am not sure how to do it from Excel :-)
0
 

Accepted Solution

by:
storkpmtbox earned 0 total points
ID: 10993748
I must say: I am a bit disappointed

For me this problem was pretty important and thus I did not stop looking for a solution........ and I found it. Here we go:

Like I stated before in this question: it had something to do with CLSID's and version numbers.

It seemed that some of the PC's used where using a NEWER version of the OCX than the others (this was an officialy unreleased development version). The result was that any Excel sheet created on a PC with this higher version number would not work on other machines but the other way aroud it would work!

Thus the solution was:
- uninstall everything regarding the OCX
- use regfixer to be sure every peace of registry crap is deleted
- Install the right version (lower version)
- Recreate the Excel sheets with the OCX components (or clean up the existing sheet by deleting the OCX objects, the references and recreating them)
- Make sure you DON'T have any excel [OCX object name].EXD files hanging around on the PC (delete them)
- everybody's happy :-)

I found al the information I needed on the internet (unfortunately not at Experts Exchange). The tools I used to determine the versionnumbers installed on the PC and the version numbers used by Excel are:
- Microsoft's OLEVIEW (search for OLEVIEW.EXE on the download site)
- The DocFileViewer from Andre .v.d. Merwe at: http://users.iafrica.com/d/da/dart/zen/Source/ByLang/Delphi/DocFileUtils/DocFileViewer/df__DocFileViewer.html

Seems I've become an expert myselve ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

919 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

20 Experts available now in Live!

Get 1:1 Help Now