Using a Variable value in a custom ribbon

lukez

Board Regular
Joined
Nov 6, 2014
Messages
56
Not sure if this is possible, I can't seem to figure it out.
I made a custom ribbon menu, which is stored in the Excel.officeUI file. For one of the button labels (or description) I would like to have it display a variable in a stored xla file. Is there a way to do something like:
variabletouse = "test123" in macro sub stored in macro.xla saved in c:/data/

Modifying the Excel.officeUI file for the button to be:
label="This is " & c:/data/macro.xla!macro (variabletouse)
so that the label reads "This is test123"
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I confess I do not know if it is possible to specify callbacks in the officeUI file, but I doubt it. You would need to alter the CustomUI part of the add-in and have it create the button when loaded. You can then use callbacks like getLabel to alter the label of the control as need be.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top