ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to call COM Add-In functions from a macro (https://www.excelbanter.com/excel-programming/298460-how-call-com-add-functions-macro.html)

Graham[_7_]

How to call COM Add-In functions from a macro
 
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:


Bob Phillips[_6_]

How to call COM Add-In functions from a macro
 
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)

"Graham" wrote in message
...
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:




Graham[_7_]

How to call COM Add-In functions from a macro
 
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

Bob Phillips[_6_]

How to call COM Add-In functions from a macro
 
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" wrote in message
...
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





All times are GMT +1. The time now is 11:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com