Wierd--Excel Control on custom ribbon doesn't work!

ACommandLineKindaGuy

Active Member
Joined
May 11, 2002
Messages
378
Office Version
  1. 365
Platform
  1. Windows
I have a custom ribbon with some built in controls for text formatting. Here's an XML snippet:
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
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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