I am trying to setup a custom ribbon in Excel using the Custom UI Editor. My goal is to have a checkbox in the ribbon for the user to check or uncheck, and I would like to read the state of the checkbox and use it in a "IF" statement in my VBA to decide if I want to execute some code or not.
As a simple example, in the Custom UI Editor within a ribbon, tab, group, I have:
<checkBox id = "checkboxShowMessage"
label = "Show Message">
Then in the VBA in a sub I have:
if checkboxShowMessage.CheckState = True then
Msgbox ("Message is shown")
end if
This is giving me an object not defined error. I don't know if I need to use CheckState, or IsChecked, or whatever, I see examples on the net with both. I also don't know if the "checkboxShowMessage" is a child in an Object such that I would need to do something like another example I saw that said RibbonControls.checkboxShowMessage, etc... I'm lost, Please help!
As a simple example, in the Custom UI Editor within a ribbon, tab, group, I have:
<checkBox id = "checkboxShowMessage"
label = "Show Message">
Then in the VBA in a sub I have:
if checkboxShowMessage.CheckState = True then
Msgbox ("Message is shown")
end if
This is giving me an object not defined error. I don't know if I need to use CheckState, or IsChecked, or whatever, I see examples on the net with both. I also don't know if the "checkboxShowMessage" is a child in an Object such that I would need to do something like another example I saw that said RibbonControls.checkboxShowMessage, etc... I'm lost, Please help!