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


Guest


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 http://www.add-in-express.com/creating-addins-blog/2010/07/02/standalone-application-addin-communicate/ article on our technical blog.
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


Guest


You are welcome, Francisco!

Thank you for keeping me up to date.
Posted 05 Oct, 2011 08:35:29 Top