Call COM addin option from VBA

Can I call a parameter on a COM add-in from a VBA macro in Word or Excel 2007? The COM add-in was written using VSTO - it adds a custom ribbon tab with several parameters that I want to execute from the VBA macro.

  • I can reference the add-in using Application.COMAddIns ("MyAddinName"), but I cannot find an option to call the option.
  • I also played with the Application.CommandBars collection and see that you can execute the parameter using CommandBarControl.Execute, but I cannot find my command line in the Application.CommandBars collection.

Does anyone know if this is possible?

+4
source share
1 answer

If you are still interested in a solution: I found this blog on the Internet (after fooobar.com/questions/390101 / ... ).

You can reveal the functionality inside your add-in by overriding the AddIn.RequestComAddInAutomationService () method and returning the class you want to provide.

In your situation, you can define the class using a method that calls the same code in your add-in as the ribbon button, and provide this VBA method.

0
source

Source: https://habr.com/ru/post/1308157/


All Articles