ACommandLineKindaGuy
Active Member
- Joined
- May 11, 2002
- Messages
- 378
- Office Version
- 365
- Platform
- Windows
I have a custom ribbon with some built in controls for text formatting. Here's an XML snippet:
The Indent controls don't work when all other text formatting controls do, including controls I haven't shown in the XML snippet, like bold, italics, font size, and so on.
It's easy enough to just replace the built-in indent controls with:
with the following in VBA:
But now if I'm in a protected cell, the workaround controls of course are not disabled, whereas the built-in controls are. I suppose I could add an errorhandler to the subs, but the point is, why do I even need to do this workaround?
TIA John
XML:
<gallery idMso="CellFillColorPicker" showLabel="false"/>
<toggleButton idMso="AlignLeft" showLabel="false"/>
<toggleButton idMso="AlignCenter" showLabel="false"/>
<toggleButton idMso="AlignRight" showLabel="false"/>
<button idMso="IndentDecreaseExcel"/>
<button idMso="IndentIncreaseExcel"/>
The Indent controls don't work when all other text formatting controls do, including controls I haven't shown in the XML snippet, like bold, italics, font size, and so on.
It's easy enough to just replace the built-in indent controls with:
XML:
<button id="customButton7" size="normal" imageMso="IndentDecreaseExcel" onAction="IndentMinus"/>
<button id="customButton8" size="normal" imageMso="IndentIncreaseExcel" onAction="IndentPlus"/>
with the following in VBA:
VBA Code:
Sub IndentPlus(control As IRibbonControl)
With Selection
.IndentLevel = .IndentLevel + 1
End With
End Sub
Sub IndentMinus(control As IRibbonControl)
With Selection
.IndentLevel = .IndentLevel - 1
End With
End Sub
But now if I'm in a protected cell, the workaround controls of course are not disabled, whereas the built-in controls are. I suppose I could add an errorhandler to the subs, but the point is, why do I even need to do this workaround?
TIA John