简体   繁体   中英

How can I press an Excel Addin's Ribbon Button using C#? (Reuters Excel Addin)

I am writing ac# application to get data from excel where the data comes from an excel Reuters Addin.

The Reuters addin creates two excel Ribbons (menu tabs next to "Home", "Insert", etc.) "Thomson Reuters Datastream" and "Thomson Reuters".

In order to use the Retuers addin functions in excel, I first need to press the "Logon" button in the "Thomson Reuters Datastream" ribbon (so that it is green and says "Online" instead of red and "Offline") because it needs to be "Online" or else the Reuters addin functions won't work.

How can I push this button (access the Ribbon and make sure the Logon button is "Online", if not then press the button) from c#?

I am comfortable creating an Excel Application object in C# and manipulating cells etc but don't know how to press an addin's ribbon button.

Any help/guidance is much appreciated!

Thank you!

I dont think it is possible with custom addins, if it is built in tab then you can use

Application.CommandBars.ExecuteMso()

For automating controls in custom ribbon tabs this might help you

Automate Office Ribbon through MSAA (CSOfficeRibbon​Accessibility)

在插件中找到一个内置选项,将其设置为始终登录,因此无需操纵插件的功能区,但如果有人遇到解决方案,这将很有趣

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