Solved

Active X and Automation of Excel

Posted on 1998-06-25
2
156 Views
Last Modified: 2013-11-25
I have built an Active X application as per the manual, then I built the exe to launch the Active X app all fine so far.  I use OLE automation to "Poke" data into Excel spreadsheets, this also works BUT....
When I make mods to the Active X app and rebuild it I have problems with Excel and the launch exe reporting they can't find the reference to the Active X app. "Missing" is the term used on the project reference.

I think this will drive me mad a 20 second mod to the Active X takes 3 mins to clear and re make the references again in Excel and VB

I am using VB 5 Pro Office 97 and NT4 on a Pent 2 with 32 Mb of RAM
Any offers?
0
Comment
Question by:Matthew123
2 Comments
 
LVL 5

Accepted Solution

by:
yronnen earned 100 total points
ID: 1464322
ActiveX exe/dll are com objects. Each COM object has a unique ID called CLSID which is written in the registry. When your application requests services from a COM object, it addresses the registry and gets the location of the required COM object.

When you change the interface of the COM object (which means - changing the existing methods/properties), the CLSID of the COM object is changed.

What happend is that you've changed the interface of your ActiveX, so it's CLSID is changed. Your client application looks for the OLD CLSID, and that's why you get these "missing" errors.

Solutions:
1. Do not change the existing methods/properties of your ActiveX. Instead - add new methods that will do your requests.
2. If you do not want to do what I've told you at 1, you will have to re-compile your client app, and re-connect it using the references. Like you do now.

By the way, you CAN change the inside of your existing methods, this is not considered as changing interface. You can't, however change the declarion of your method.

For example, this will change the ActiveX CLSID:
old method : sub Mysub(D as string)
New method: sub Mysub(D as integer, X as single).
0
 

Author Comment

by:Matthew123
ID: 1464323
Yronnen
Thanks is there a way of automating the CLSID look up process, recompiling the VB exe is fine but Excel is subject to mestod 2.   Oh well Thanks a lot

Cheers

Matt
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 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

15 Experts available now in Live!

Get 1:1 Help Now