Excel 2007 Ribbon Question

crimmelcp

Board Regular
Joined
Dec 21, 2009
Messages
50
To all:
Using UIEditor you can add icons to the XLSM package.
When you build your ribbon bar, then you can reference those icons.

Is there a way using VB that when a user clicks the icon on the ribbon bar, Vb can copy the icon in the XLSM pacgege and paste it into the active cell.

If anyone wants to try, I can email them a copy of the icons.(Just Private message me. I cannot attach file to this board)

Below is the code for the UIEditor that builds the Tickmarks Tab on the Ribbon bar.

Charlie Crimmel

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<
ribbon startFromScratch="false">
<
tabs>
<
tab id="customTab" label="TickMarks">
<
group id="firstGroup" label="Tick Marks">
<
button id="button1" image="Checkmark" label="Check Mark" onAction="CheckMark1"/>
<
button id="button1a" image="Checkmark2" label="CheckMark2" onAction="CheckMark2"/>
<
button id="button2" image="_x0031_" label=" 1 " onAction="One1"/>
<
button id="button3" image="_x0032_" label=" 2 " onAction="Two2"/>
<
button id="button4" image="_x0033_" label=" 3 " onAction="Three3"/>
<
button id="button5" image="_x0034_" label=" 4 " onAction="Four4"/>
<
button id="button6" image="_x0035_" label=" 5 " onAction="Five5"/>
<
button id="button7" image="_x0036_" label=" 6 " onAction="Six6"/>
<
button id="button8" image="_x0037_" label=" 7 " onAction="Seven7"/>
<
button id="button9" image="_x0038_" label=" 8 " onAction="Eight8"/>
<
button id="button10" image="A" label=" A " onAction="A1"/>
<
button id="button11" image="B" label=" B " onAction="B2"/>
<
button id="button12" image="C" label=" C " onAction="Cee"/>
<
button id="button13" image="D" label=" D " onAction="D4"/>
<
button id="button14" image="E" label=" E " onAction="E5"/>
<
button id="button15" image="F" label=" F " onAction="F6"/>
<
button id="button16" image="G" label=" G " onAction="G7"/>
<
button id="button17" image="Diamond" label="Diamond" onAction="Diamond"/>
<
button id="button18" image="Doubledeck" label="Doubledeck" onAction="Doubledeck"/>
<
button id="button19" image="Footer" label="Footer" onAction="Footer"/>
<
button id="button20" image="GL" label=" GL " onAction="GL"/>
<
button id="button21" image="IM" label=" IM " onAction="IM"/>
<
button id="button22" image="LY" label=" LY " onAction="LY"/>
<
button id="button23" image="Nocircle" label="Nocircle" onAction="Nocircle"/>
<
button id="button24" image="rectangle" label="Rectangle" onAction="rectangle"/>
<
button id="button25" image="SD" label=" SD " onAction="SD"/>
<
button id="button26" image="Sigma" label="Sigma" onAction="Sigma"/>
<
button id="button27" image="TB" label=" TB " onAction="TB"/>
<
button id="button28" image="Teepee" label="Teepee" onAction="Teepee"/>
<
button id="button29" image="Boxes" label="Boxes" onAction="Boxes"/>
<
button id="button30" image="Bullseye" label="BullsEye" onAction="Bullseye"/>
<
button id="button31" image="Calculated" label="Calculated" onAction="Calculated"/>
<
button id="button32" image="Fish" label="Fish" onAction="Fish"/>
<
button id="button33" image="Graphline" label="Graph Line" onAction="GraphLine"/>
<
button id="button34" image="Reversefooter" label="Reverse Footer" onAction="Reversefooter"/>
<
button id="button35" image="Stageright" label="Stage Right" onAction="stageright"/>
 
 
 
<
menu id="menu1" label="Menu example">
<
button id="menuButton1" image="Checkmark" label="Check Mark" onAction="Checkmark1"/>
<
button id="menuButton2" image="Checkmark2" label="Check Mark 2" onAction="CheckMark2"/>
<
button id="menuButton3" image="_x0031_" label=" 1 " onAction="One1"/>
<
button id="menuButton4" image="_x0032_" label=" 2 " onAction="Two2"/>
<
button id="menuButton5" image="_x0033_" label=" 3 " onAction="Three3"/>
<
button id="menuButton6" image="_x0034_" label=" 4 " onAction="Four4"/>
<
button id="menuButton7" image="_x0035_" label=" 5 " onAction="Five5"/>
<
button id="menuButton8" image="_x0036_" label=" 6 " onAction="Six6"/>
<
button id="menuButton9" image="_x0037_" label=" 7 " onAction="Seven7"/>
<
button id="menuButton10" image="_x0038_" label=" 8 " onAction="Eight8"/>
<
button id="menubutton11" image="A" label=" A " onAction="A1"/>
<
button id="menubutton12" image="B" label=" B " onAction="B2"/>
<
button id="menubutton13" image="C" label=" C " onAction="Cee"/>
<
button id="menubutton14" image="D" label=" D " onAction="D4"/>
<
button id="menubutton15" image="E" label=" E " onAction="E5"/>
<
button id="menubutton16" image="F" label=" F " onAction="F6"/>
<
button id="menubutton17" image="G" label=" G " onAction="G7"/>
<
button id="menubutton18" image="Diamond" label="Diamond" onAction="Diamond"/>
<
button id="menubutton19" image="Doubledeck" label="Doubledeck" onAction="Doubledeck"/>
<
button id="menubutton20" image="Footer" label="Footer" onAction="Footer"/>
<
button id="menubutton21" image="GL" label=" GL " onAction="GL"/>
<
button id="menubutton22" image="IM" label=" IM " onAction="IM"/>
<
button id="menubutton23" image="LY" label=" LY " onAction="LY"/>
<
button id="menubutton24" image="Nocircle" label="Nocircle" onAction="Nocircle"/>
<
button id="menubutton25" image="rectangle" label="Rectangle" onAction="rectangle"/>
<
button id="menubutton26" image="SD" label=" SD " onAction="SD"/>
<
button id="menubutton27" image="Sigma" label="Sigma" onAction="Sigma"/>
<
button id="menubutton28" image="TB" label=" TB " onAction="TB"/>
<
button id="menubutton29" image="Teepee" label="Teepee" onAction="Teepee"/>
<
button id="menubutton30" image="Boxes" label="Boxes" onAction="Boxes"/>
<
button id="menubutton31" image="Bullseye" label="BullsEye" onAction="Bullseye"/>
<
button id="menubutton32" image="Calculated" label="Calculated" onAction="Calculated"/>
<
button id="menubutton33" image="Fish" label="Fish" onAction="Fish"/>
<
button id="menubutton34" image="Graphline" label="Graph Line" onAction="GraphLine"/>
<
button id="menubutton35" image="Reversefooter" label="Reverse Footer" onAction="Reversefooter"/>
<
button id="menubutton36" image="Stageright" label="Stage Right" onAction="stageright"/>
</
menu>
<
menu id="menu2" label="Command Bars">
<
button id="menu2Button1" label="Command Bars" onAction="ListCommandBar"/>
</
menu>
<
menu id="menu3" label="Load Image">
<
button id="menu3Button1" label="Load Image" onAction="LoadImage"/>
</
menu>
</
group>
</
tab></tabs></ribbon></customUI>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Not tested but should work.

In order to load the image you will need to unzip the workbook.
As you can not unzip the activeworkbook you will need to create a temporary version using the SaveCopyAs method.
You can then change the new temporary file to .zip in order to get at the relevant image file in the \CustomIU\Images sub folder.

You can make use of Jan Karel's code for unzipping xlsm files.
http://msdn.microsoft.com/en-gb/library/dd819387.aspx
 
Upvote 0

Forum statistics

Threads
1,225,554
Messages
6,185,632
Members
453,310
Latest member
fish5748

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