Translate

Monday, November 28, 2011

Galleries in the Ribbon (Excel 2007 & 2010)

There are many controls that you can add to the Ribbon and one of them is a Gallery.
On this page you can download a few example workbooks that are maybe useful if you
want to create your own Gallery on the Ribbon.

If you are new to this Ribbon stuff and want to learn more I suggest you buy this book:
RibbonX: Customizing the Office 2007 Ribbon
http://www.amazon.com/RibbonX-Customizing-Office-2007-Ribbon/dp/0470191112

Note: Every example file will use RibbonX to create a custom tab on the Ribbon with a Gallery control.
If you click on a picture or Label in the Gallery it will run the macro that belong to this picture or Label,
read the comments in the VBA code good.

If you want to see/change the RibbonX read the information on my Ribbon page about the Custom UI Editor.
There are also many other examples on that page.
http://www.rondebruin.nl/ribbon.htm


Download example files

Download :  RDBGalleries.zip
After you unzip the zip file you have one folder named "Img" with 12 pictures in it and four Excel files (xlsm).

If you read the Gallery article on MSDN :
http://msdn.microsoft.com/en-us/library/dd756403.aspx

Then download the example files here: RDBGalleryMSDN.zip


Picture Galleries

Note: The pictures (Laaf people) you see I made in this amusement park : http://www.efteling.com/





RDB Gallery Pictures 1

This file load every picture that is in the "Img" folder into the Gallery.
The advantage of this is that it is easy to Add/Change/Remove pictures.
In the VBA code we can Add/Change/Remove the Screen tips and the
macros that you run if you click on a picture.
There is no need to edit the RibbonX to do the things above.
Note: After you make the changes Save/close/Reopen the workbook to see them


RDB Gallery Pictures 2

In this example we can only change the macros in the VBA editor.
If you want to Add/Change/Remove pictures and Screen tips you must edit the RibbonX.
Note: The pictures are a part of the Excel file.





Label Galleries




RDB Gallery Labels 1

In this example we can change almost everything in the VBA editor.
We can Add/Change/Remove Labels and Screen tips in the VBA code
and Add/Change/Remove the macros that you run if you click on a label.
There is no need to edit the RibbonX to do the things above.
Note: After you make the changes Save/close/Reopen the workbook to see them


RDB Gallery Labels 2

In this example we can only Add/Change/Remove the macros that you run if you click on a label.
If you want to Add/Change/Remove Labels and Screen tips you must edit the RibbonX.




More information

To make your pictures smaller in size you can use this free program.
http://www.irfanview.com/

Dynamic Ribbon Galleries by Sam Radakovitz
http://blogs.msdn.com/b/excel/archive/2007/08/07/sam-radakovitz-on-dynamic-ribbon-galleries.aspx

Change the Ribbon in Excel 2007 or Excel 2010
http://www.rondebruin.nl/ribbon.htm

No comments:

Share It

Related Posts Plugin for WordPress, Blogger...