Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Active X and Automation of Excel

Posted on 1998-06-25
2
Medium Priority
?
162 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 200 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

877 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