user626528
user626528

Reputation: 14417

How to make ribbon have different buttons enabled in different workbooks?

There is only one ribbon object in the add-in, so it's shared between all workbooks. How I can make different ribbon buttons enabled in different workbooks?

Upvotes: 0

Views: 254

Answers (1)

Jake Ginnivan
Jake Ginnivan

Reputation: 2142

I assume you are talking about Ribbon XML as the designer tries to make it seem like the ribbon is more based on the document.

If you are using Ribbon XML as I suspect, then this is very difficult and I would suggest two options. Either switch to the Ribbon Designer, which you can handle the Loaded and other events and set the .Enabled property on the button controls. Or give http://vstocontrib.codeplex.com/ a go, it is designed to make this scenario much easier. Have a read of the doco around the Ribbon Factory.

Upvotes: 1

Related Questions