Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Active X and Automation of Excel

Posted on 1998-06-25
2
Medium Priority
?
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
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…
Suggested Courses

704 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