ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assign a Ribbon Control's Label from a Variable in VBA Code (https://www.excelbanter.com/excel-programming/422981-assign-ribbon-controls-label-variable-vba-code.html)

jean grey

Assign a Ribbon Control's Label from a Variable in VBA Code
 
Hi, everyone. I have a very simple question.
As the subject indicates, how do I assign a ribbon control's label from a
variable in VBA Code?
for example, I have a button declared as:

<button id="Btn1" label="My button" onAction="File.xls!MyButtonAction"/

but instead, I want to get the label from the VBA code declared as:

Public Const Btn1Label As String = "My button"

Thanks in advance. :)

Ron de Bruin

Assign a Ribbon Control's Label from a Variable in VBA Code
 
Hi jean grey

Why not use Get Label, see
http://www.rondebruin.nl/dynamic.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"jean grey" wrote in message ...
Hi, everyone. I have a very simple question.
As the subject indicates, how do I assign a ribbon control's label from a
variable in VBA Code?
for example, I have a button declared as:

<button id="Btn1" label="My button" onAction="File.xls!MyButtonAction"/

but instead, I want to get the label from the VBA code declared as:

Public Const Btn1Label As String = "My button"

Thanks in advance. :)


Bob Phillips[_3_]

Assign a Ribbon Control's Label from a Variable in VBA Code
 
I don't think that you can, the controls are not exposed. But the callback
is invoked when the button is clicked, so you action it there.

What are you trying to do?

--
__________________________________
HTH

Bob

"jean grey" wrote in message
...
Hi, everyone. I have a very simple question.
As the subject indicates, how do I assign a ribbon control's label from a
variable in VBA Code?
for example, I have a button declared as:

<button id="Btn1" label="My button" onAction="File.xls!MyButtonAction"/

but instead, I want to get the label from the VBA code declared as:

Public Const Btn1Label As String = "My button"

Thanks in advance. :)




jean grey

Assign a Ribbon Control's Label from a Variable in VBA Code
 
Thanks, Ron. That was what I needed. :)

"Ron de Bruin" wrote:

Hi jean grey

Why not use Get Label, see
http://www.rondebruin.nl/dynamic.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"jean grey" wrote in message ...
Hi, everyone. I have a very simple question.
As the subject indicates, how do I assign a ribbon control's label from a
variable in VBA Code?
for example, I have a button declared as:

<button id="Btn1" label="My button" onAction="File.xls!MyButtonAction"/

but instead, I want to get the label from the VBA code declared as:

Public Const Btn1Label As String = "My button"

Thanks in advance. :)




All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com