PDA

View Full Version : Solved: RibbonX - Label update



shockandawe
08-19-2011, 08:57 AM
I'm really strugling with this one...

I'm trying to create a spreadsheet that has a custom control in the ribbon. This contol will be an EditBox. I would like the label for this control to be dynamic. The label will be fed from a cell on my Excel spreadsheet.

How do I "trigger" the label to update? I would like to put code in my Worksheet_Change event that will update the label. How do I call a Ribbon event from VBA?

I hope this make sense.

Bob Phillips
08-19-2011, 10:28 AM
You can't from VBA. You can use callback code to set the label, but that callback is invoked when the ribbon starts up. You cannot change it from some Excel event I am afraid.

Paul_Hossler
08-20-2011, 05:56 AM
If I understand what you want to do, I usually .Invalidate the control from VBA

That will cause the Ribbon control to 're-initialize' itself and pick up any status, etc. changes

Paul

shockandawe
08-21-2011, 01:48 PM
The Invalidate did the trick. Thank you very much.