Call functions in add-in from VBA

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

Call functions in add-in from VBA
 
Subscribe
Steve Weixel




Posts: 2
Joined: 2024-01-05
I have an addin, where I was using a very old version (7.2). I recently upgraded to the latest (10.2) and one key apsect no longer works. From VBA (in Excel), I was getting the proxy object from COMAddIn.Object and was able to call functions in my actual addin. That no longer works, I get "Object doesn't support this property or method". How can I forward calls to my addin?
Posted 05 Jan, 2024 16:32:06 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello Steve,

Try calling a public property of method declared on the add-in module. Use the following code path:

ExcelApp.COMAddins.Item(strMyComAddinProgId).Object.MyPublicPropertyOrMethod.

1. strMyComAddinProgId - see the ProgId attribute of your add-in module.
2. MyPublicPropertyOrMethod is called via late binding (see System.Type.InvokeMember in MSDN or search through our forums)

See also http://www.add-in-express.com/creating-addins-blog/2010/07/02/standalone-application-addin-communicate/.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Jan, 2024 16:28:18 Top
Steve Weixel




Posts: 2
Joined: 2024-01-05
Sorry I've been super busy and unable to get back to this until now. What you showed me is what I've already been doing. It turns out when I reorganized my code to work with the new version, the public functions I had been calling were no longer on my object. Anyway, it works now, thanks!
Posted 15 Mar, 2024 04:58:00 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello Steve,

No problem about being busy: we do understand such situations and sometimes we are super busy ourselves.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Mar, 2024 08:50:27 Top