简体   繁体   中英

Run a 3rd party Excel Add-in from VBA

I want to programatically run a 3rd party Add-in with VBA alone. Im using Excel 2010

Ideally, I'd like to be able to call the functions individually however I don't have any access to the code of the Add-in (it doesn't even appear as a password protected VBA Project it did in Excel 2003).

Hours of Googling has told me this was possible in earlier versions of Excel, either through Application.CommandBars("Add-Ins").Controls("Custom Button").Execute or CommandBars.ExecuteMso("Custom Button") - AFAIK, the latter now only works with in-built functions.

This custom button also appears in the 'Right-Click' menu so could possibly be run with some sort of SendKeys implementation. This is however, clearly far from ideal.

I'm pulling my hair out over this - any help would be greatly appreciated.

Depending on how it has been added to the menu, this may work:

Application.Commandbars("Cell").Controls(Application.Commandbars("Cell").Contro‌​ls.Count).Execute

which simply executes the last control. Also this should work by the control caption:

Application.Commandbars("Cell").Controls("the button caption").Execute

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM