Solved

Active X and Automation of Excel

Posted on 1998-06-25
2
157 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

778 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