Custom UI - Default color picker

Jaye Cavallo

New Member
Joined
Mar 10, 2022
Messages
45
Office Version
  1. 2016
Platform
  1. Windows
I have created a custom tab for my Excel file. Would someone be able to guide me through the process of adding to my custom tab Excel's default color picker, the icon on the home tab with a paint bucket icon that drops down with the theme colors, standard colors, recently used colors, no fill, and more colors?

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">

<!-- <commands> -->
<!-- Disable Save As in the Backstage(File)menu in 2010 -->
<!-- <command idMso="FileSaveAs" enabled = "false" /> -->
<!-- </commands> -->

<ribbon>
<tabs>
<tab id="MyCustomTab" label="Outreach" insertBeforeMso="TabHome">

<!-- Group for Shading -->

<group id="group1" label="FillColor">

<button id="FillColor1" label="Fill Yellow" onAction="Callback"
imageMso="ShadingPicker"
screentip="Fill Selected Cells with Yellow"
/>

<button id="FillColor2" label="Fill Green" onAction="Callback2"
imageMso="ShadingPicker"
screentip="Fill Selected Cells with Green"
/>

<button id="FillColor3" label="Fill Blue" onAction="Callback3"
imageMso="ShadingPicker"
screentip="Fill Selected Cells with Blue"
/>

<button id="FillColor4" label="No Fill" size="large" onAction="Callback4"
imageMso="ShadingPicker"
screentip="Remove Fill Color"
/>

</group>
</tab>
</tabs>
</ribbon>
</customUI>
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
First we'll need to find the control's ID. Therefore, let's first display the dialog box for customizing the ribbon...

VBA Code:
Ribbon >> File >> Options >> Customize Ribbon

Now you'll see the following dialog box...

customize_ribbon.PNG


Then, move your cursor over Fill Color in the Popular Commands window on the left. Then you'll see the control's ID displayed, which in this case is CellFillColorPicker...

control_id.PNG


Now that we know the control's ID, the following line can be added to your code...

VBA Code:
<control idMso="CellFillColorPicker" />

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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