Solved

Active X and Automation of Excel

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
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…

830 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