Accessing a COM add-in from an Excel Macro

Add-in Express™ Support Service
That's what is more important than anything else

Accessing a COM add-in from an Excel Macro
Accessing a COM add-in from an Excel Macro 
Francisco Rodrigues




Posts: 18
Joined: 2011-06-30
Hi,

I implemented an Excel add-in and now I'm trying to use one of it's methods in an Excel macro.

1. Is this possible?
2. I declared a public method and tried to invoke it using "ExcelApp.COMAddIns.Item("MyExcelAddin.AddinModule").Object.test" but nothing happens. Is this the way to do it?

Do you have an example of how to do it?

Thanks,

Francisco
Posted 29 Sep, 2011 08:06:46 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Francisco,

1. Sure. It is possible.
2. Please make sure that your add-in was loaded by the host application. Did you try to debug?

Please take a look at the HowTo: Communicate with a COM add-in from a standalone application article on our technical blog.
.NET, Extended MAPI, Windows Phone & RT
Posted 29 Sep, 2011 08:14:59 Top
Francisco Rodrigues




Posts: 18
Joined: 2011-06-30
Eugene,

Sorry for not replying before. I made a mistake when writing the Excel macro code. I wrongly used:

ExcelApp.COMAddIns.Item("MyExcelAddin.AddinModule").Object.test


instead of

Application.COMAddIns.Item("MyExcelAddin.AddinModule").Object.test


Once I corrected this mistake everything worked fine.

Thanks,

Francisco
Posted 05 Oct, 2011 08:31:40 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
You are welcome, Francisco!

Thank you for keeping me up to date.
.NET, Extended MAPI, Windows Phone & RT
Posted 05 Oct, 2011 08:35:29 Top