Custom Ribbon:

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi if i have XML code, how can I use it to build/modify my ribbon...:)

Thanks for helping.

Current XML
Code:
[/FONT]
[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]customUI[/COLOR][COLOR=#ff0000] xmlns[/COLOR][COLOR=#0000ff]="[/COLOR][B][COLOR=#ff0000]http://schemas.microsoft.com/office/2006/01/customui[/COLOR][/B][COLOR=#0000ff]">[/COLOR][/FONT]
[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]ribbon startFromScratch[/COLOR][COLOR=#0000ff]="[/COLOR][B]true[/B][COLOR=#0000ff]">[/COLOR][/FONT]
[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]tabs[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]
[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]tab id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Tab5[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]Mytab1[/B][COLOR=#0000ff]">[/COLOR][/FONT]
[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]group id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Group5[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]Clock[/B][COLOR=#0000ff]">[/COLOR][/FONT]
[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]button[/COLOR] [COLOR=#990000]id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Button5[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]Clock[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] size[/COLOR][COLOR=#0000ff]="[/COLOR][B]large[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] onAction[/COLOR][COLOR=#0000ff]="[/COLOR][B]Custom_Btn_Macro1[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] imageMso[/COLOR][COLOR=#0000ff]="[/COLOR][B]MsnLogo[/B][COLOR=#0000ff]" />[/COLOR] [/FONT]

[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]group[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]


[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]tab[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]


[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]tab id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Tab6[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]MyTab2[/B][COLOR=#0000ff]">[/COLOR][/FONT]
[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]group id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Group6[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]Hi[/B][COLOR=#0000ff]">[/COLOR][/FONT]
[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]button[/COLOR] [COLOR=#990000]id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Button6[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]Hi[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] size[/COLOR][COLOR=#0000ff]="[/COLOR][B]large[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] onAction[/COLOR][COLOR=#0000ff]="[/COLOR][B]Custom_Btn_Macro2[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] imageMso[/COLOR][COLOR=#0000ff]="[/COLOR][B]CustomActionsMenu[/B][COLOR=#0000ff]" />[/COLOR] [/FONT]

[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]group[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]


[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]tab[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]


[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]tab id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Tab7[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]MyTab3[/B][COLOR=#0000ff]">[/COLOR][/FONT]
[URL="file:///E:/Personal%20Files/eBooks/customUI.xml#"][B][FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT][/B][/URL][FONT=Courier New] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]group id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Group7[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]Why[/B][COLOR=#0000ff]">[/COLOR][/FONT]
[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]button[/COLOR] [COLOR=#990000]id[/COLOR][COLOR=#0000ff]="[/COLOR][B]Button7[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] label[/COLOR][COLOR=#0000ff]="[/COLOR][B]Why[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] size[/COLOR][COLOR=#0000ff]="[/COLOR][B]large[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] onAction[/COLOR][COLOR=#0000ff]="[/COLOR][B]Custom_Btn_Macro3[/B][COLOR=#0000ff]"[/COLOR][COLOR=#990000] imageMso[/COLOR][COLOR=#0000ff]="[/COLOR][B]ActionInsert[/B][COLOR=#0000ff]" />[/COLOR] [/FONT]

[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]group[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]


[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]tab[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]


[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]tabs[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]


[FONT=Courier New][B][COLOR=#ff0000] [/COLOR][/B] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]ribbon[/COLOR][COLOR=#0000ff]>[/COLOR][/FONT]



[FONT=Courier New]
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi Glen, it does help but kind of complicated for user like me...[not that easy to understand...] but thanks again. If there is something simplier....then it would be great..


And one thing that concern me is if i follow this instruction and does customization to the ribbon will this effect every workbook i have or just the one 'm 'm customizing?:)

Thanks again.
 
Upvote 0
Glen, thanks again... Yes the XML was from the same page
I downloaded it but doesn't work @ work only home...it error in 2 places
Do u have any idea why the error might occur? Thanks
 
Upvote 0
Use this code

PHP:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> 
<ribbon startFromScratch="true"> 
<tabs>
<tab id="Tab5" label="Mytab1"> 
<group id="Group5" label="Clock">
<button id="Button5" label="Clock" size="large" onAction="Custom_Btn_Macro1" imageMso="MsnLogo"/>
</group>
</tab>
<tab id="Tab6" label="MyTab2">
<group id="Group6" label="Hi">
<button id="Button6" label="Hi" size="large" onAction="Custom_Btn_Macro2" imageMso="CustomActionsMenu" /> </group>
</tab>
<tab id="Tab7" label="MyTab3">
<group id="Group7" label="Why">
<button id="Button7" label="Why" size="large" onAction="Custom_Btn_Macro3" imageMso="ActionInsert" /> </group>
</tab>
</tabs>
</ribbon>
</customUI>

and

Code:
'Callback for Button5 onAction
Sub Custom_Btn_Macro1(control As IRibbonControl)
    MsgBox "Hello Macro1"
    
End Sub
'Callback for Button6 onAction
Sub Custom_Btn_Macro2(control As IRibbonControl)
    MsgBox "Hello Macro2"
End Sub
'Callback for Button7 onAction
Sub Custom_Btn_Macro3(control As IRibbonControl)
    MsgBox "Hello Macro3"
End Sub

in a code module.
 
Upvote 0
S M C, thanks for getting back on this..i thought everyone has given up...I myself did go through different links but quite difficult to understand...


Where i enter PHP code? the module code i can take care of it i think..:). When you're online please do help me out on this.


Thanks again.
 
Upvote 0
By the way, it is an XML code, not a PHP. I only used a PHP code wrap just for the sake of readabilty.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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