How to call COM Add-In functions from a macro

G

Graham

I am new to COM Add-Ins and have implemented the
Microsoft example:
HOW TO: Build an Office COM Add-in by Using Visual
Basic .NET
Reg: http://support.microsoft.com/default.aspx?
kbid=302896

This worked fine. However, it only shows how to include a
user defined button. I wish to add additional member
functions to the connect class, or a new class, that can
be called from macros within Excel.

I am using vb.Net 2002 and Excel XP.

Any help much appreciated.


Regards:
 
B

Bob Phillips

Graham,

Here is an article that shows how. It is not .Net based, but you should
still be able to apply

HOWTO: Create a Visual Basic Automation Add-in for Excel Worksheet Functions
http://support.microsoft.com/default.aspx?kbid=285337

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
G

Graham

Bob,

Thanks for the reference. I have tried to adapt the VB6 Automation ideas but have got in a bit of a muddle. In my original attempt based on:

HOWTO: Create a Visual Basic Automation Add-in for Excel Worksheet Functions
http://support.microsoft.com/default.aspx?kbid=285337

the COM Add-In loads and the OnConnection routines operate and bring up messages when the Add-In loads. The problem is that I cannot access any functions that I include from Excel macros. I just cannot seem to access the Add-In direct. Also, I cannot see the Add-In under tools/Addins even though I know it has loaded.

Sorry if I am being stupid :)

Regards,

Graham
 
B

Bob Phillips

Graham,

What version of Excel do you have? I ask because I have just read the
article, and it specifically mentions XL2002. I re-created the example using
XL2002, and when I clicked the Automation tab, that created the ProgId
registry key mentioned in the other article. And everything worked fine
(except the functions seemed odd<g>).

Then I tried to repeat it in XL2000, and I got the same results as you. I
manually created the I knew the addin loaded (I added a MsgBox to prove it),
but I couldn't see it either, or run those functions.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Graham said:
Bob,

Thanks for the reference. I have tried to adapt the VB6 Automation ideas
but have got in a bit of a muddle. In my original attempt based on:
HOWTO: Create a Visual Basic Automation Add-in for Excel Worksheet Functions
http://support.microsoft.com/default.aspx?kbid=285337

the COM Add-In loads and the OnConnection routines operate and bring up
messages when the Add-In loads. The problem is that I cannot access any
functions that I include from Excel macros. I just cannot seem to access
the Add-In direct. Also, I cannot see the Add-In under tools/Addins even
though I know it has loaded.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top