<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://excelusergroup.org/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"><channel><title>Excel User Group</title><link>http://excelusergroup.org/blogs/default.aspx?GroupID=2</link><description>MVP Blogs</description><dc:language>en-US</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>UK Excel Developers Conference</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2010/06/15/uk-excel-developers-conference.aspx</link><pubDate>Tue, 15 Jun 2010 21:35:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:7072</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;All&lt;/p&gt;
&lt;p&gt;Wanted to pass along details of a great event happening for Excel Developers in London on July 12th 2010.&lt;/p&gt;
&lt;p&gt;With confirmed presenters of Simon Murphy and Charles Williams and focussing on high-end developers in Excel including VSTO, Excel 2010 and VS2010, it will be well worth the &amp;pound;150 fee for the day.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://smurfonspreadsheets.wordpress.com/2010/06/09/excel-developer-conference-london-monday-july-12-2010/" title="UK Excel Developers Conference"&gt;Detail Here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=7072" width="1" height="1"&gt;</description></item><item><title>World Cup Fantasy Football Model</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2010/06/10/world-cup-fantasy-football-model.aspx</link><pubDate>Thu, 10 Jun 2010 22:43:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:7027</guid><dc:creator>Admin</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Written for Excel 2007 and 2010, I have uploaded a model which allows you to run a fantasy football league for friends, colleagues, etc. You just add their names, enter the scores and the rest is done.&lt;/p&gt;
&lt;p&gt;automatically updates and sorts league tables and all formulas and code is open for all to see&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have fun (I dare say this could be adapted for future tournaments?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=7027" width="1" height="1"&gt;</description><enclosure url="http://www.nickhodge.co.uk/blog/wp-content/files/World%20Cup%202010%20(2007%20Auto).zip" length="56298" type="application/zip" /><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Football+World+Cup/default.aspx">Football World Cup</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Excel+2010/default.aspx">Excel 2010</category></item><item><title>You Need To Buy This…</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2009/11/03/you-need-to-buy-this.aspx</link><pubDate>Tue, 03 Nov 2009 16:11:09 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:5058</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;All&lt;/p&gt;  &lt;p&gt;John Walkenbach is having a blow-out sale on his Power Utility Pak for Excel with 80% off!&lt;/p&gt;  &lt;p&gt;To be sure of getting your copy you need to &lt;a href="http://www.spreadsheetpage.com/index.php/twohoursale" target="_blank"&gt;head over here&lt;/a&gt; between the hours of 4pm and 6pm (GMT) to qualify.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=5058" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Add-Ins/default.aspx">Add-Ins</category></item><item><title>Excel User Conference next week</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2009/10/02/excel-user-conference-next-week.aspx</link><pubDate>Fri, 02 Oct 2009 06:08:19 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:4851</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;As some of you will know, the boys (Bob, Charles, Simon, Andy, Roger and myself) are presenting another FREE series of courses at Microsoft’s Office in Cardinal Place, London for 2 days on October 7th/8th.&lt;/p&gt;  &lt;p&gt;This is a repeat of the hugely oversubscribed event in April where we had over 120 reserves who places couldn’t be found for. So far we have around 100 attending so places left for around another 20 on either or both days.&lt;/p&gt;  &lt;p&gt;If you fancy coming along to this great FREE event (except accommodation and evening entertainment) then drop a line to bookings at excelusergroup dot org. (re-assemble as indicated)&lt;/p&gt;  &lt;p&gt;Should be great fun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=4851" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Conference/default.aspx">Conference</category></item><item><title>Useless Fact Of The Day</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2009/07/06/useless_2D00_fact_2D00_of_2D00_the_2D00_day.aspx</link><pubDate>Mon, 06 Jul 2009 06:27:51 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:4416</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Day-40_2C00_000_5F00_2.jpg" target="_blank"&gt;&lt;img style="border-right-width:0px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" border="0" alt="Day 40,000" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Day-40_2C00_000_5F00_thumb.jpg" width="524" height="499" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Excel uses a date system based on it&amp;#39;s official start date of 01/01/1900. Days are whole numbers and decimals are time values, so, for example if you type 01/01/1900 12:00 into Excel and then go to Format it as &amp;#39;General&amp;#39; you will see behind the date and time sits a value, which should be 1.5 (Day 1 and half a day in time).&lt;/p&gt; &lt;p&gt;Why all this nauseam? Well, today is 40,000. Having struggled with Excel through the 30,000&amp;#39;s today feels like the first day of the rest of my life ;-)&lt;/p&gt; &lt;p&gt;Caveat: It isn&amp;#39;t actually the 40,000 day since 01/01/1900 as Microsoft, to keep compatibility with Lotus 1-2-3 which was the leading spreadsheet of the day, duplicated the error that Lotus had that 1900 was a leap year and included 29th February. Of course it wasn&amp;#39;t so I guess day 40,000 is actually tomorrow????&lt;/p&gt; &lt;p&gt;For loads of other great time and date stuff go to:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.cpearson.com/excel/datetime.htm"&gt;www.cpearson.com/excel/datetime.htm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=4416" width="1" height="1"&gt;</description></item><item><title>Office 2007 SP2 Released</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2009/04/29/office-2007-sp2-released.aspx</link><pubDate>Wed, 29 Apr 2009 20:39:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:4050</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Office SP2 has been released officially &lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=B444BF18-79EA-46C6-8A81-9DB49B4AB6E5&amp;amp;displaylang=en%20"&gt;here&lt;/a&gt;. The list of changes against Excel seems fairly small but having been running the beta for some time it does seem quite a bit better, additionally there are improvements across the suite, probably most noticeably the speed in Outlook.&lt;/p&gt;
&lt;p&gt;Additionally support has been added for the Open Document Format (ODF) which is &amp;#39;compatible&amp;#39; with stuff like Google Documents, although there are some areas where that just doesn&amp;#39;t work, but expect that to get better over time. Here is the link to &lt;a target="_blank" href="http://support.microsoft.com/kb/953195"&gt;what has been changed&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;span style="color:#000000;"&gt;&lt;strong&gt; &lt;/strong&gt;I&amp;#39;m grateful to Stan Scott of New York, who forwarded me a &lt;a target="_blank" href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/SP2-Changes.xls"&gt;document containing all the changes to all applications in Office 2007 SP2&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=4050" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Excel+2007/default.aspx">Excel 2007</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Service+Packs/default.aspx">Service Packs</category></item><item><title>Excel User Conference Piccies</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2009/04/05/excel-user-group-piccies.aspx</link><pubDate>Sun, 05 Apr 2009 01:59:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:3863</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/IMG_5F00_0187.jpg"&gt;&lt;img height="244" width="164" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/IMG_5F00_0187_5F00_thumb.jpg" align="left" alt="IMG_0187" border="0" style="border-bottom:0px;border-left:0px;margin:0px 10px 10px 0px;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; Bob Phillips kindly took a few pictures of the recent conference which by his own admission he should have taken more of. It shows all the presenters, except, of course Bob and gives you a flavour that there where plenty of delegates and lots of &amp;#39;action&amp;#39;. What was Simon Murphy doing? Although he is an &amp;#39;all action&amp;#39; speaker.&lt;/p&gt;
&lt;p&gt;Thanks for taking those Bob and I agree, more next time.&lt;/p&gt;
&lt;p&gt;For those delegates wondering, the links to the slide decks and the files should be uploaded by tomorrow, (Monday 6th April) and we will email with the link(s)&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://picasaweb.google.co.uk/xld.bob/EUC2009?authkey=Gv1sRgCInI_OSvi8iHgQE"&gt;Here is the URL&lt;/a&gt; (for the photos)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=3863" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Conference/default.aspx">Conference</category></item><item><title>Excel User Conference 2009</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2009/03/31/excel-user-conference-2009.aspx</link><pubDate>Tue, 31 Mar 2009 20:57:43 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:3835</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Tomorrow sees the start of the two day event at Microsoft&amp;#39;s cardinal Place site in London. We have some great speakers and topics lined up and the event has been oversubscribed since about a week after it was announced. That I think is a measure of what a great event it should be.&lt;/p&gt; &lt;p&gt;Watch this space for updates afterwards and hopefully we will also get some files too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=3835" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Conference/default.aspx">Conference</category></item><item><title>Today's Large Data Set</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2009/02/24/today-s-large-data-set.aspx</link><pubDate>Tue, 24 Feb 2009 08:38:58 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:3545</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Now, since Excel 2007 was announced to be having over 1 million rows, I made the statement, &amp;quot;Be careful what you wish for&amp;quot;. Excel is not a database, there are programs far more suited to that task such as Access, SQL Server, SAP, Oracle, etc. Excel is a great reporting tool for those databases and can do fast and quite complex calculations much better than a database can.&lt;/p&gt; &lt;p&gt;What I am conceding more and more now though, is that as my familiarity with Excel is far greater than with SQL Server. I find myself taking large data sets out of SQL to do stuff that either the database is not good at, or more often where my T-SQL language skills let me down.&lt;/p&gt; &lt;p&gt;One such occurrence yesterday was trying to get a twelve month running average over weekly data for 30,000 items (per week) a data set which was currently around 850,000 records. The weekly update each Saturday night, being added to the total was not the problem, the setting up of the historical data was. Either the server choked on the physical task, or the data was not quite what I wanted. (Back to my T-SQL inadequacies).&lt;/p&gt; &lt;p&gt;What would have been impossible before 2007, well not impossible, but messy. Was to take out the data into Excel, work with it there and then, after saving it back as a .txt, tab delimited file. (SQL Server drivers seem to not yet cope with the new Excel formats), upload it back into SQL Server, either directly updating the original table, or more often to a temporary table which can then simply be linked to the original table and the data updated or added, very simple and painless.&lt;/p&gt; &lt;p&gt;A couple of caveats though. Much of my work is on &amp;#39;one-offs&amp;#39; to get me out of a corner and I use a lot of VBA snippets work the data. On this occasion I was having to drop in different worksheet functions based on the data. I wrote my 10-12 lines of code to run and set it off. Now, when I am running code over large data sets, although it has an overhead, I like to see where the code has got to, so, for example, in a for each...next loop, I always write the row number to the status bar. I then get an idea how long I need to walk away from my machine. (Coffee break, lunch or vacation?), like so.&lt;/p&gt; &lt;p&gt;For Each myCell in Range(&amp;quot;D1:D856456&amp;quot;)&lt;br /&gt;&amp;#39;Do stuff here...&lt;br /&gt;Application.Statusbar = myCell.Row&lt;br /&gt;Next myCell&lt;/p&gt; &lt;p&gt;In the data I was working the other day it was a simple AVERAGE w/s function, but was taking a very long time. Of course, I had forgotten to turn calculation to manual at the start of my code so stopped the code (vacation otherwise) and added the line&lt;/p&gt; &lt;p&gt;Application.Calculation=xlCalculationManual&lt;/p&gt; &lt;p&gt;Remembering to switch it back on afterwards, although Excel will take the setting from the first workbook opened in a session, so we should be OK.&lt;/p&gt; &lt;p&gt;I ran it again and still noticed it was dragging a little and a quick sum showed I should take a half day off ;-)&lt;/p&gt; &lt;p&gt;What I had forgotten, is that, as I was inserting random ranges in the AVERAGE function based on other data, Excel was trying to set the &amp;#39;error&amp;#39; flags, (The little green triangle in the top right corner of a cell when the formula does not match those of the cells around) on each cell as the code ran. Turning those off and we were away. The code now taking less than 20 minutes (a long coffee break) to run. The line to turn them off&lt;/p&gt; &lt;p&gt;application.ErrorCheckingOptions.BackgroundChecking=False&lt;/p&gt; &lt;p&gt;Again remember to turn them back on. (If that&amp;#39;s what you want)&lt;/p&gt; &lt;p&gt;So, are 1,000,000+ rows in Excel a good thing? Not really, but it doesn&amp;#39;t half come in handy. (With caveats)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=3545" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Excel+2007/default.aspx">Excel 2007</category></item><item><title>Excel User Conference (an update)</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2009/01/27/excel-user-conference-an-update.aspx</link><pubDate>Tue, 27 Jan 2009 03:34:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:3316</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;The guys who are organising this event. (Bob Phillips, Roger Govier, Andy Pope, Charles Williams, Simon Murphy&amp;nbsp;and I), have been overwhelmed by the response for the forthcoming event in London on April 1st and 2nd.&lt;/p&gt;
&lt;p&gt;We have been &amp;#39;technically full&amp;#39; almost from the start with floods of delegates and are operating a reserve list. (We have even had to turn down adverts on the likes of Office Online, etc). As it is a free event however, people do not have huge amounts of &amp;#39;skin&amp;#39; in the day, so we are emailing regularly to ascertain if people can still come and then promote from the &amp;#39;wait list&amp;#39;. (MS advise us that up to 40% can drop out of free events, although we have more than that on reserve too).&lt;/p&gt;
&lt;p&gt;It should be a fantastic couple of days for the 104 delegates anyhow, whoever they may be.&lt;/p&gt;
&lt;p&gt;The update is that, &amp;#39;the guys&amp;#39; are also talking about a repeat in the autumn with priority given to people on the reserve list. We have not all agreed yet and not approached MS, but this is the current thinking. It certainly could be filled, no doubt!&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=3316" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Conference/default.aspx">Conference</category></item><item><title>My First 15 Minutes?</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/12/10/my_2D00_first_2D00_15_2D00_minutes.aspx</link><pubDate>Wed, 10 Dec 2008 19:32:05 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:3082</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/logooffice_5F00_2.jpg" target="_blank"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:0px 10px 0px 0px;border-right-width:0px;" height="40" alt="logooffice" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/logooffice_5F00_thumb.jpg" width="169" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Everyone will be famous for 15 minutes... dunno who said that but as many of you know I live a double life as downright nice, jolly chap on one hand and geek on the other!&lt;/p&gt; &lt;p&gt;Some time ago I wrote a blog about getting External Data into the new 2007 version of Excel. Well, it grew a little into a full-blown article and it has just been published on the main Office Online web site at Microsoft.com.&lt;/p&gt; &lt;p&gt;&lt;a href="http://office.microsoft.com/en-us/excel/HA103382101033.aspx" target="_blank"&gt;The article is here&lt;/a&gt;&lt;/p&gt; &lt;p&gt;...end of 15 minutes and back to obscurity!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=3082" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/External+Data/default.aspx">External Data</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>UK Excel User Group Conference</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/12/05/uk-excel-user-group-conference.aspx</link><pubDate>Fri, 05 Dec 2008 17:47:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:3052</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>12</slash:comments><description>&lt;p&gt;A meeting of the above group will take place on &lt;strong&gt;Wednesday 1st and Thursday 2nd April 2009 in London&lt;/strong&gt;. This &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;FREE&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt; event has some fantastic speakers from the Excel community.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;The agenda for the two days is outlined below and you can book for either or both days by emailing &lt;a href="mailto:bookings@excelusergroup.org"&gt;bookings@excelusergroup.org&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;Microsoft will be providing the venue and the hospitality and we look forward to a great and informative couple of days. The agenda is below, but if you want the full version with session details and speaker bios, &lt;a href="http://excelusergroup.org/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/UK-Excel-User-Group-Meeting-Rev2.doc"&gt;you can download the&amp;nbsp;Word document&amp;nbsp;file here&lt;/a&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Venue: &lt;br /&gt;&lt;/b&gt;&lt;b&gt;Microsoft London (Cardinal Place)&lt;/b&gt; &lt;br /&gt;100 Victoria Street &lt;br /&gt;London SW1E 5JL &lt;br /&gt;Tel: 0870 60 10 100&lt;/p&gt;
&lt;p&gt;Agenda:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Wednesday 1st April 2009&lt;/strong&gt;&lt;/p&gt;
&lt;table cellpadding="1" cellspacing="0"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Event&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Speaker&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9:15am - 9:45am&lt;/td&gt;
&lt;td&gt;Registration &amp;amp; coffee&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9:45am - 10:00am&lt;/td&gt;
&lt;td&gt;Welcome&lt;/td&gt;
&lt;td&gt;Nick Hodge&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10:00am - 10:45am&lt;/td&gt;
&lt;td&gt;Working smart with the Excel grid&lt;/td&gt;
&lt;td&gt;Simon Murphy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10:45am - 11:45am&lt;/td&gt;
&lt;td&gt;Intermediate functions&lt;/td&gt;
&lt;td&gt;Bob Phillips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11:45am - 12:15pm&lt;/td&gt;
&lt;td&gt;Coffee&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12:15pm - 1:15pm&lt;/td&gt;
&lt;td&gt;What&amp;#39;s in a name?&lt;/td&gt;
&lt;td&gt;Charles Williams&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1:15pm - 2:00pm&lt;/td&gt;
&lt;td&gt;Lunch&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2:00pm - 2:45pm&lt;/td&gt;
&lt;td&gt;TBA&lt;/td&gt;
&lt;td&gt;Microsoft&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2:45pm - 3:30pm&lt;/td&gt;
&lt;td&gt;Tips and tricks in charting&lt;/td&gt;
&lt;td&gt;Andy Pope&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3:30pm - 4:00pm&lt;/td&gt;
&lt;td&gt;Coffee&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4:00pm - 5:00pm&lt;/td&gt;
&lt;td&gt;Pivot tables&lt;/td&gt;
&lt;td&gt;Roger Govier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5:00pm - 5:30pm&lt;/td&gt;
&lt;td&gt;Pre-submitted Q&amp;amp;A&lt;/td&gt;
&lt;td&gt;All&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5:30pm - Late&lt;/td&gt;
&lt;td&gt;Dinner, drinks, etc&lt;/td&gt;
&lt;td&gt;All (Inc. Delegates)&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Thursday 2nd April 2009&lt;/strong&gt;&lt;/p&gt;
&lt;table cellpadding="1" cellspacing="0"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Event&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Speaker&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8:30am - 9:00am&lt;/td&gt;
&lt;td&gt;Registration &amp;amp; coffee&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9:00am - 9:15am&lt;/td&gt;
&lt;td&gt;Welcome&lt;/td&gt;
&lt;td&gt;Nick Hodge&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9:15am - 10:00am&lt;/td&gt;
&lt;td&gt;Data exchange&lt;/td&gt;
&lt;td&gt;Nick Hodge&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10:00am - 11:00am&lt;/td&gt;
&lt;td&gt;VBA - It&amp;#39;s in everyone&amp;#39;s reach&lt;/td&gt;
&lt;td&gt;Simon Murphy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11:00am - 11:30am&lt;/td&gt;
&lt;td&gt;Coffee&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11:30am - 12:45pm&lt;/td&gt;
&lt;td&gt;Information - Visualising data&lt;/td&gt;
&lt;td&gt;Andy pope &amp;amp; Bob Phillips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12:45pm - 1:30pm&lt;/td&gt;
&lt;td&gt;Lunch&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1:30pm - 2:15pm&lt;/td&gt;
&lt;td&gt;Arrays and array functions&lt;/td&gt;
&lt;td&gt;Bob Phillips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2:15pm - 3:15pm&lt;/td&gt;
&lt;td&gt;Speeding up Excel&lt;/td&gt;
&lt;td&gt;Charles Williams&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3:15pm - 3:45pm&lt;/td&gt;
&lt;td&gt;Tea &amp;amp; coffee&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3:45pm - 4:30pm&lt;/td&gt;
&lt;td&gt;Pre-submitted Q&amp;amp;A&lt;/td&gt;
&lt;td&gt;All&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4:30pm&lt;/td&gt;
&lt;td&gt;Close&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=3052" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Events/default.aspx">Events</category></item><item><title>Excel 2007 - Getting External Data</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/11/04/excel-2007-getting-external-data.aspx</link><pubDate>Tue, 04 Nov 2008 19:31:15 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:2905</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;On of the most visited parts of my web site is the part on external data. Most of it was based on Excel 2003 and before, so I thought I should update it for Excel 2007.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;INTRODUCTION&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The first thing you will notice about 2007 is the ease in which you can find the data &amp;#39;movement&amp;#39; tools. Now, say what you think about the ribbon in Excel 2007, but finding where to import and export data is not one of them! It&amp;#39;s on the Data tab. (as below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/data-tab_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="161" alt="data tab" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/data-tab_5F00_thumb.jpg" width="437" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;I have only shown you the section above. The tab extends beyond this with groups for sorting and filtering, validation and de-duping tools and grouping stuff. We will only be using these two groups. (Get External Data and Connections)&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;SIMPLE IMPORTS&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;The first three buttons from the left are easily discoverable and ready-rolled versions of the old commands available through the Data&amp;gt;Get External Data&amp;gt;New Database Query... (See below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/old-menu-options_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="270" alt="old menu options" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/old-menu-options_5F00_thumb.jpg" width="431" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The &amp;#39;From Access&amp;#39; and &amp;#39;From Text&amp;#39; options, simply throw up an &amp;#39;Open&amp;#39; dialog to allow you to navigate to your selected file. It should be noted that the Access variant is compatible with versions of Access pre-2007, allowing extensions of *.mdb (2003 and before) and *.accdb (2007), as well as their &amp;#39;project&amp;#39; equivalents (*.mde and *.accde). The text import version allows import of *.prn (space delimited), *.txt (tab, or other delimiter) and *.csv (comma delimited).&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;IMPORTANT TIP:&lt;/u&gt;&lt;/strong&gt; There is also an option, when selecting text, to select *.* all files. (see below).&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/all-files_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="485" alt="all files" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/all-files_5F00_thumb.jpg" width="615" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;This is important when you have columns with data that may begin with a zero, for example part numbers like 000123456. Using any other driver for import will have Excel simply strip these off, leaving you with 123456. This will be a real problem when you come to do any VLOOKUPs or similar as one will not see the other.&lt;/p&gt; &lt;p&gt;So, the trick is, remove whatever extension you have completely. (To do this in later versions of windows you will likely have to go to any Windows Explorer window and select &amp;#39;Folder Options...&amp;#39; (In Vista this is under the &amp;#39;Organise&amp;#39; option) and on the &amp;#39;View&amp;#39; tab, de-select to &amp;#39;Hide known file extensions&amp;#39;. (In other words to show them), see below).&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Hide-extensions_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="483" alt="Hide extensions" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Hide-extensions_5F00_thumb.jpg" width="400" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You will get warned about changing file extensions being dangerous and you can ignore that! You will then end up with the usual icon for a file that windows shows when it has an unknown file extension.&lt;/p&gt; &lt;p&gt;Taking this route will launch the Import Wizard, allowing you to set the part number column (for example) as text, thus keeping your leading zeroes (more on this option later). This is the only successful way I know of doing this as Excel, through any of it&amp;#39;s proprietary drivers, does not seem to honour field &amp;#39;types&amp;#39;.&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;IMPORTING FROM ACCESS (or most other OLEDB data sources)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;So, taking the first option will throw up the dialog to navigate to your database file (as outlined above), once you have done this you will be presented with a dialog, showing the tables and queries (views) in that database file, select the relevant one and click &amp;#39;OK&amp;#39;.&lt;/p&gt; &lt;p&gt;You will notice from the dialog below that I name my Tables, tblXXXXX and my Queries, qryXXXXX. This helps me to easily see them and also sorts them neatly. However, if you do not do this, you should note the icon for each is different, with the one for Queries or Views looking like two overlaid table icons. (as below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Select-Table_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="387" alt="Select Table" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Select-Table_5F00_thumb.jpg" width="529" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Select your table and you then get loads of options to place your data into the workbook. (see below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/import-to-where_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="254" alt="import to where" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/import-to-where_5F00_thumb.jpg" width="304" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Most of these will be self-explanatory but listed you can have the data as a new 2007 formatted table (the default), a pivot table, or a pivot chart &lt;u&gt;and&lt;/u&gt; pivot table. Equally you can decide whether you want the data placed in the existing worksheet (and where on that sheet) or a new sheet. Don&amp;#39;t forget also the &amp;#39;Properties...&amp;#39; button that will throw up a dialog, as below, to turn on, or off, some features of the resulting connection to your data source. Key on the usage tab is a descriptive name and description, as this will now appear under the &amp;#39;Connections&amp;#39; button on the &amp;#39;Connections&amp;#39; group on the &amp;#39;Data&amp;#39; tab. A feature allowing future manipulation of this connection which was difficult, or near impossible in earlier versions of Excel. Also, you may like to set the &amp;#39;Enable background refresh&amp;#39; (default) so that you can work with Excel while the data is refreshed in the background. This becomes relevant if you set the data to refresh every nth seconds. Probably the most useful setting to ensure &amp;#39;one version of the truth&amp;#39;, is the &amp;#39;refresh data when opening file&amp;#39; setting. Even though Excel will fire the security bar to warn that the data may be unsafe (unless you have trusted the location or similar), as soon as you &amp;#39;release&amp;#39; this the data will update with the live data in the source.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/connection-properties_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="508" alt="connection properties" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/connection-properties_5F00_thumb.jpg" width="423" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The definition tab (below) allows you to change the connection string, which is handy if you move the file or similar, it also is a good way to get the string if you are using it in VBA or .NET code.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/definition-tab_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="508" alt="definition tab" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/definition-tab_5F00_thumb.jpg" width="423" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Finishing all these dialogs will return your data to the Excel worksheet as a table or pivot table template, as below&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/table_5F00_4.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="152" alt="table" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/table_5F00_thumb_5F00_1.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/pt-template_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="244" alt="pt template" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/pt-template_5F00_thumb.jpg" width="129" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Once you have your data on the sheet you will notice that not only are the &amp;#39;Refresh All&amp;#39; and &amp;#39;Connections&amp;#39; button on the Connections group &amp;#39;lit&amp;#39; (as top), but also the Properties one is also. If specifically you are in a new Excel 2007 table, this shows some nice features to expand column widths, include row numbers from the data source and whether you want you data replacing and deleting the existing data or appending it.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/external-data-properties_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="291" alt="external data properties" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/external-data-properties_5F00_thumb.jpg" width="363" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Bear in mind, once you have your external data in Excel, you are only a right click away (in the table or Pivot) from selecting &amp;#39;refresh&amp;#39; to get an updated view of the data.&lt;/p&gt; &lt;p&gt;Much of what you have learned under this Access heading will stand you in good stead for all other sources as in fact it is using an OLEDB data source &amp;#39;under the covers&amp;#39;, the same as you will use for SQL, Oracle, or most other modern data sources. The only difference will be if you are using a server technology, is you will not navigate to a file, you will use a server name.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;IMPORTING FROM THE WEB&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Once you use this technology it is surprising how much you will use it in the future. It is great for grabbing for example order screens as receipts and also any kind of list. I suspect however that most people use it to keep up to date with stocks and shares and, providing the site owner doesn&amp;#39;t mess with the URLs you need only open Excel and refresh each time to see the latest data, as with any other data source. This is the example we will be using. (Using Microsoft&amp;#39;s Stock Symbol on Yahoo (MSFT).&lt;/p&gt; &lt;p&gt;&lt;a href="http://uk.finance.yahoo.com/q?s=MSFT&amp;amp;m=L&amp;amp;d=" target="_blank"&gt;Here is the URL&lt;/a&gt; (Today)&lt;/p&gt; &lt;p&gt;Firstly we will go to the &amp;#39;From Web&amp;#39; button. (See above). This effectively launches a browser window into which you can either enter the URL or paste it as with any other browser. (see below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/webdatabrowser_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="385" alt="webdatabrowser" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/webdatabrowser_5F00_thumb.jpg" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Notice above that this control &amp;#39;senses&amp;#39; the table in the data and places&amp;nbsp; small yellow boxes with right facing arrows to show them. All you do now is simply click on any table you want to select, which will turn the yellow marker to green with a tick and click &amp;#39;Import&amp;#39;. Now, when doing this with just these default settings, Excel imports a pretty bland, text representation of the data, (see below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/web-bland-data_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="376" alt="web bland data" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/web-bland-data_5F00_thumb.jpg" width="220" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;To alter this you should, before importing press the &amp;#39;Options...&amp;#39;button, top right of the dialog, (see above). This will give you several choices, (see 1st below), the two most crucial of which are, &amp;#39;Full HTML formatting&amp;#39; and &amp;#39;Disable date recognition&amp;#39;. The former ends up with the data looking far prettier and much like it is on the web page itself (see 2nd below), the second will stop data such as 1-1-00 (possibly financial data, from being converted to 01/01/2000 (as a date).&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Web-Data-Options_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="449" alt="Web Data Options" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Web-Data-Options_5F00_thumb.jpg" width="596" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/formatteddata_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="389" alt="formatteddata" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/formatteddata_5F00_thumb.jpg" width="235" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now, as with any other data on the worksheet, you can simply either press the &amp;#39;Refresh&amp;#39; button on the &amp;#39;Data&amp;#39; tab or right click on the data and select &amp;#39;Refresh&amp;#39;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;IMPORTING FROM TEXT&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Remember, that a csv file (comma separated values) is a native form to Excel. You will notice this by looking at the file icon. It is like a normal one but with a letter &amp;#39;a&amp;#39; and a comma. If you double-click directly on a csv file, excel will open it. Sometimes this is undesirable, so I suggest you take the &amp;#39;Important Tip&amp;#39; route above.&lt;/p&gt; &lt;p&gt;If you have any other text file format than csv, you should open it using the &amp;#39;From Text&amp;#39; button. Remember too, that even if Excel doesn&amp;#39;t open the file format you have (Quicken for example), you will nearly always be able to save as some text format within the source program, so you should do that.&lt;/p&gt; &lt;p&gt;Pressing the button simply presents a navigation dialog to go to the file, as below&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/importtextdialog_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="484" alt="importtextdialog" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/importtextdialog_5F00_thumb.jpg" width="614" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Once again, you have the option in the bottom right to show all files (*.*), so if you file does not have a *.prn, *.txt or *.csv extension you will need to use that.&lt;/p&gt; &lt;p&gt;Pressing the &amp;#39;Open&amp;#39; button presents you with the three step Text Import Wizard allowing you to specify the data steps. The three dialogs are shown below&lt;/p&gt; &lt;p&gt;Step 1 allows you to specify whether the file is delimited (has a character of some type between each column (field), e.g. comma, tab, space (you will notice the commas separating my data) and the other usual option allows you to start the import at a certain row. This is handy when certain systems simply output a paper report to text file and the report has headings as this will allow you to strip those rows out.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/TextImport1_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="422" alt="TextImport1" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/TextImport1_5F00_thumb.jpg" width="589" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Step 2, if you have, as I have selected &amp;#39;delimited&amp;#39; in step one, will allow you to select the delimiter. In my case this is comma but if you have any other you can select from the choices or select &amp;#39;other&amp;#39; and enter the character in the box. If you had selected &amp;#39;fixed width&amp;#39; in step one. (That is field one is say always 10 characters, field 2. 30 characters and so on), then this step allows you to click at the fixed widths of your data to set the delimiting &amp;#39;bars&amp;#39;.&lt;/p&gt; &lt;p&gt;If you are likely to have consecutive delimiters, e.g. an address file that is comma delimited may have commas at the end of an address line, then you should select to &amp;#39;Treat consecutive delimiters as one&amp;#39;. Some data systems also output text data, as opposed to numeric data, surrounded by double quotes, if so, select that from the &amp;#39;Text qualifier&amp;#39; drop down.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/TextImport2_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="422" alt="TextImport2" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/TextImport2_5F00_thumb.jpg" width="589" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The last step allows you to set the columns as certain data types or not import at all. This is where, as I have done in column 5, you can set you data as text and retain you leading zeroes. Equally, as you can see in column 8, I have selected &amp;#39;Do not import column&amp;#39; and it has placed &amp;#39;Skip Column&amp;#39; in the heading and it will not be imported.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/TextImport3_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="422" alt="TextImport3" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/TextImport3_5F00_thumb.jpg" width="589" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Clicking finish returns the data to the worksheet and you are done!&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;IMPORTING FROM OTHER SOURCES&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This is where Excel uses it&amp;#39;s OLEDB or ODBC drivers that are loaded on the machine&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;IMPORTANT:&lt;/u&gt;&lt;/strong&gt; It is possible that your driver list will not match mine and you may not be able to import from an AS400 DB2 for example. This is because your machine is not loaded with the driver for that data source, nothing to do with your excel installation. Remember, if you are setting this up for someone else, their machine too must have the relevant driver and connection file in most cases.&lt;/p&gt; &lt;p&gt;For purposes of this demonstration, I will be using SQL Server as my data source, but frankly, if a driver is available, it could be just about anything. Generally you may prefer to use the OLEDB drivers, which will create a transferable connection file, but if all else fails, you can use MS Query, an age old tool in Excel that is a little like Access and uses ODBC as it&amp;#39;s connection technology. It&amp;#39;s a bit like dropping back to VGA if you have trouble with hi performance video drivers!&lt;/p&gt; &lt;p&gt;Below are your menu choices from the &amp;#39;From Other Sources&amp;#39; button.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/FromOtherSourcesMenu_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="302" alt="FromOtherSourcesMenu" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/FromOtherSourcesMenu_5F00_thumb.jpg" width="370" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Selecting SQL Server presents us with a Data Connection Wizard which you can use to set the necessary settings for your connection. The three steps are outlined below.&lt;/p&gt; &lt;p&gt;The first step allows you to specify the server name. (my example, (local), connects to the local machine server). I most instances Windows Authentication will be OK. This is a system whereby Windows manages your passwords, meaning your network logon suffices for SQL, email, etc, etc. On occasions, each user will have a logon specific to the data source or even a table. If that is the case,as will often be on remote/shared databases, you would select the other option and enter a user name and password.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/dataconnectwizard1_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="371" alt="dataconnectwizard1" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/dataconnectwizard1_5F00_thumb.jpg" width="530" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The second step offers you the specific database in the named server you want to connect to. Changing this will present you with a list of table and queries (views) in that particular database, on that named server. Equally, if you want to select this each time you use the connection then you can uncheck the &amp;#39;Connect to a specific table&amp;#39; check box and you will be prompted each time. As before the icons for Tables and views are different to ease identification. (I use a different naming convention in SQL server, uv-xxx-xxxxxxx is a user view (query) and the tables are named in plain English. Don&amp;#39;t ask me why, I&amp;#39;ve always been a little quirky!)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/dataconnectwizard2_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="424" alt="dataconnectwizard2" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/dataconnectwizard2_5F00_thumb.jpg" width="553" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Step three allows you to name the connection file and give it a description to help in search as as an aide memoir on what it does. There are tons of other metadata stuff you could put here, but that&amp;#39;s about it.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/dataconnectwizard3_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="443" alt="dataconnectwizard3" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/dataconnectwizard3_5F00_thumb.jpg" width="530" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;From here on in returning data to the worksheet follows the same route as under the Access section.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;USING PARAMETERS IN QUERIES AND MS QUERY (ODBC)&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;NOTE: &lt;/u&gt;&lt;/strong&gt;This is a repeat of the same subject in another post on my blog, but as that one was set in XL2003 and is the most hit entry, I thought I would update it for 2007.&lt;/p&gt; &lt;p&gt;If all the above fails, you can drop back to the &amp;#39;age old&amp;#39; method of MS Query which uses ODBC technology. The operation of this can be seamless, without you even seeing an interface, but what I would like to show is a way you can use dynamic parameters on your worksheet to choose the data shown.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;NOTE:&lt;/u&gt;&lt;/strong&gt; A standard install of Excel may not install this feature (can&amp;#39;t remember), if you do not have this option, re-insert your installation media and chose to &amp;#39;add and remove features&amp;#39; and select all the data options you can see!&lt;/p&gt; &lt;p&gt;So, let&amp;#39;s start.&lt;/p&gt; &lt;p&gt;When I am intending to work with parameters on a worksheet, I tend to enter the placeholders for these first. this will help when the interface asks for the parameters and tries to retrieve the data. (I am going to pull data between 2 dates, remember I am in the UK locale so our dates are formatted dd/mm/yyyy). So the worksheet would look like below.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/parameter-start_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="111" alt="parameter start" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/parameter-start_5F00_thumb.jpg" width="205" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;I am hoping when we connect to the data (table or query) we will bring through initially all catalogues with a mail date between 1st Jan 07 and 1st Sep 07.&lt;/p&gt; &lt;p&gt;Next we will select the &amp;#39;From Microsoft Query&amp;#39; option from the &amp;#39;Other Sources&amp;#39; button, (see above). This will launch a dialog asking us to choose a data source (see below). (Data sources are files stored on you machine (or in the file) that are available to connect to data, you will recognise some in the screen shot, but some are specific source files on my own machine. the location of these files on your machine can be accessed by clicking the Options... button).&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/choose-data-source_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="245" alt="choose data source" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/choose-data-source_5F00_thumb.jpg" width="472" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;We are connecting to a SQL server, so I will select the top option of &amp;#39;New Data Source...&amp;#39; as I don&amp;#39;t currently have a connection I need. This will launch another dialog to&amp;nbsp; name the data source and select the driver.(see below), again, if you don&amp;#39;t see what you need you will need to install the driver for that data source from the relevant program vendor.&lt;/p&gt; &lt;p&gt;I have selected SQL Server from the drop down and called it Local SQL (Any name you will recognise will do)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/choose-data-source_5F00_2.jpg"&gt;&lt;/a&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/createnewdatasource_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="307" alt="createnewdatasource" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/createnewdatasource_5F00_thumb.jpg" width="395" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Next you will need to connect to that data source, so clicking &amp;#39;Connect...&amp;#39; in the dialog above will present another dialog (below) to do that. (I have pressed the &amp;#39;Options&amp;gt;&amp;gt;&amp;#39; button 9dimmed in the shot below), which expands the options to connect to the database. this is a good idea if this connection is only needed to connect to one. In my case AS400UK). I have selected the (local) server, (That&amp;#39;s the one on &lt;u&gt;my&lt;/u&gt; machine) and used my trusted &amp;#39;single windows sign-on&amp;#39; connection.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/serverlogin_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="341" alt="serverlogin" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/serverlogin_5F00_thumb.jpg" width="373" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Once you clear the dialog above, you will be re-presented with the &amp;#39;Create New Data Source&amp;#39; dialog (two above), with the option to select a specific table or query (view) in the database. I leave this blank to give me a utility connection that I can select tables from as we need. Equally we will now be returned to the first dialog in this section, but this time we will have our new source of Local SQL in the list. (see below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/new-datasource-made_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="245" alt="new datasource made" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/new-datasource-made_5F00_thumb.jpg" width="472" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If we click OK we will get a wizard taking us through the steps of selecting a table, the fields we require from that table and filtering or sorting them. For the purposes of this we will not be filtering or sorting at this stage (steps 2 and 3), but below is the first screen with the CatHeader table selected and four fields within that table moved across to appear in our data.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/choosecolumns_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="315" alt="choosecolumns" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/choosecolumns_5F00_thumb.jpg" width="511" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;On the fourth screen we could simply select to return the data to Excel and that would be done, with any filtering and sorting done earlier. We want to apply parameters to our data though, so we need to select &amp;#39;View data or edit query in Microsoft Query&amp;#39; at this stage. (As below).&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/msquerylastwizzard_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="315" alt="msquerylastwizzard" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/msquerylastwizzard_5F00_thumb.jpg" width="511" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Clicking finish gives us our first view of the MS Query interface with our data in place.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/MS-Query-Criteria-Button_5F00_4.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="457" alt="MS Query Criteria Button" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/MS-Query-Criteria-Button_5F00_thumb_5F00_1.jpg" width="546" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;We need now to set our parameters and to do that we go to the add criteria button (above) which adds a grid to the interface (below). In here we need to select the field we wish to add the parameters to and enter the parameters. To enter parameters you simply put the square braces around where you want the parameters values to be placed, so in our case of wanting to get data between two dates we can enter:&lt;/p&gt; &lt;p&gt;Between [Start] And [End]&lt;/p&gt; &lt;p&gt;It matters not what you call the placeholders in the query, we could have replaced &amp;#39;Start&amp;#39; with &amp;#39;a&amp;#39; for example. (without the quotes)&lt;/p&gt; &lt;p&gt;The values we enter in the worksheet will replace the Start and End parameters. It ends up looking like below.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/criteria-grid_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="441" alt="criteria grid" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/criteria-grid_5F00_thumb.jpg" width="514" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Next we go to &amp;#39;File&amp;#39; and select &amp;#39;Return data to Microsoft Office Excel&amp;#39;. This will fire a dialog to enter each of the parameter values (See below). As we are getting these from the worksheet you should enter nothing and just click &amp;#39;OK&amp;#39; to all prompts.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/parameter-box_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="139" alt="parameter box" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/parameter-box_5F00_thumb.jpg" width="283" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;After this you will be asked where in the worksheet you wish to place the data or whether you want to put it on another worksheet, but... &lt;u&gt;WE DON&amp;#39;T WANT TO DO THAT YET!&lt;/u&gt;&lt;/p&gt; &lt;p&gt;Before doing that your should press the &amp;#39;Properties...&amp;#39; button in the dialog (1st below) and on the resulting dialog&amp;#39;s &amp;#39;Definition&amp;#39; tab (2nd below), you will notice the &amp;#39;Parameters...&amp;#39; button has &amp;#39;lit up&amp;#39;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Import-data_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="254" alt="Import data" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Import-data_5F00_thumb.jpg" width="304" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/definition-tab_5F00_4.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="508" alt="definition tab" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/definition-tab_5F00_thumb_5F00_1.jpg" width="423" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Press this and you get a dialog giving you three options. (See below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Parameter-Dialog_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="272" alt="Parameter Dialog" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Parameter-Dialog_5F00_thumb.jpg" width="532" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;ol&gt; &lt;li&gt;Prompt for value using the following string (new in 2007), allows you to have Excel fire a dialog and for you to have a customised message, say... &amp;quot;Enter the Start Date&amp;quot;&amp;nbsp; &lt;li&gt;Use a &amp;#39;hard coded&amp;#39; value every time  &lt;li&gt;Get the value from a worksheet cell. (This is the option we want). You simply enter a cell reference to the data for each parameter in the list on the left and that&amp;#39;s it!&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;To make the data refresh each time the parameter changes you should check the box at the bottom (I always do this, but if you have a very long running query it could be a problem)&lt;/p&gt; &lt;p&gt;Simply then, you just need to change the values in the cells and the data below will reflect the new values. (see below)&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Final-Table_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="377" alt="Final Table" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Final-Table_5F00_thumb.jpg" width="373" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;That&amp;#39;s about it for data interchange in Excel, remember though that in Excel 2007, you also, unlike previous versions can easily re-use data connections and edit them, right here on the &amp;#39;Data&amp;#39; tab of the new ribbon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=2905" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/External+Data/default.aspx">External Data</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Excel+2007/default.aspx">Excel 2007</category></item><item><title>Excel List of Lists</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/09/08/excel-list-of-lists.aspx</link><pubDate>Mon, 08 Sep 2008 07:55:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:2651</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;John Walkenbach on his new Spreadsheet Page has posted what he believes is a comprehensive list of Excel Blogs with RSS feeds.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://spreadsheetpage.com/index.php/excelfeeds"&gt;You can find it here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thankfully I made the list, but can you point us toward any that are missing?&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a nice job where you can select the blog in the left side bar and see the latest posts and comments all in one place.&lt;/p&gt;
&lt;p&gt;There are certainly several others on here he has missed but not to many that are active :-(&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=2651" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Links/default.aspx">Links</category></item><item><title>Deploying VSTO Add-In To Multiple Users On Windows XP</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/08/22/deploying-vsto-add-in-to-multiple-users-on-windows-xp.aspx</link><pubDate>Fri, 22 Aug 2008 07:37:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:2585</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Matthew from Australia kindly dropped by to outline a solution to a tricky situation with VSTO deployment to multiple users on Windows XP.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t profess to know the issue, but it seems like it should get a wider audience, hence the post.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://excelusergroup.org/forums/p/850/2584.aspx#2584" title="Multi-User VSTO Deployment in XP"&gt;Here is the link to Matthew&amp;#39;s solution.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=2585" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/VSTO/default.aspx">VSTO</category></item><item><title>My Coding Technique</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/08/15/my-coding-technique.aspx</link><pubDate>Fri, 15 Aug 2008 07:01:31 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:2566</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;I have recently been doing most of my coding in Visual Studio, doing some &amp;#39;real&amp;#39; work for a change, coding using VB.net, ASP.net and ADO.net.&lt;/p&gt; &lt;p&gt;The environment in VS2008 is much improved over the VBE in MS Office (VBA). For example, it auto-indents and, with the addition of Developer Express&amp;#39;s Coderush product it even adds helpful lines between these indents. In large code projects it becomes a real chore to keep pressing the tab key to indent, but it is pretty essential if you are going to be able to easily &amp;#39;read&amp;#39; and debug your code. Below is an example of my code in VS2008.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/VS2008_5F00_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="456" alt="VS2008" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/VS2008_5F00_thumb.jpg" width="755" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Another thing you also soon notice is the huge nature of the .NET framework meaning that if you don&amp;#39;t &amp;#39;type&amp;#39; your variables (that is declare them strongly as a certain &amp;#39;type&amp;#39;) you get little or no help at all and that makes the whole scenario impossible. (Well not impossible, but improbable if you are not the sort of person who can memorise Pi to 120 places or something!).&lt;/p&gt; &lt;p&gt;This brings me to my point in VBA.&lt;/p&gt; &lt;p&gt;When I first started coding, as with most I suspect, you simply recorded the code with the macro recorder and then amended that to get rid of all the unnecessary defaults it records. You then move onto hand coding but a little like this. (...again I suspect)&lt;/p&gt; &lt;p&gt; &lt;div&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;Sub&lt;/span&gt; Demo()
Application.ScreenUpdating = &lt;span style="color:#0000ff;"&gt;False&lt;/span&gt;
Application.EnableEvents = &lt;span style="color:#0000ff;"&gt;False&lt;/span&gt;
ActiveWorkbook.Worksheets(&lt;span style="color:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;).Name = &lt;span style="color:#006080;"&gt;&amp;quot;Data&amp;quot;&lt;/span&gt;
ActiveWorkbook.Worksheets(&lt;span style="color:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;).Range(&lt;span style="color:#006080;"&gt;&amp;quot;A1&amp;quot;&lt;/span&gt;).Value = &lt;span style="color:#006080;"&gt;&amp;quot;Nick&amp;quot;&lt;/span&gt;
ActiveWorkbook.Worksheets(&lt;span style="color:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;).Range(&lt;span style="color:#006080;"&gt;&amp;quot;B1&amp;quot;&lt;/span&gt;).Value = &lt;span style="color:#006080;"&gt;&amp;quot;Hodge&amp;quot;&lt;/span&gt;
&lt;span style="color:#008000;"&gt;&amp;#39;Now you could risk this...&lt;/span&gt;
Range(&lt;span style="color:#006080;"&gt;&amp;quot;C1&amp;quot;&lt;/span&gt;).Value = Range(&lt;span style="color:#006080;"&gt;&amp;quot;A1&amp;quot;&lt;/span&gt;).Value &amp;amp; &lt;span style="color:#006080;"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &amp;amp; Range(&lt;span style="color:#006080;"&gt;&amp;quot;B1&amp;quot;&lt;/span&gt;).Value
Application.ScreenUpdating = &lt;span style="color:#0000ff;"&gt;True&lt;/span&gt;
Application.EnableEvents = &lt;span style="color:#0000ff;"&gt;True&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Now, the above code will work (I know, why the application..... It&amp;#39;s just to prove a point), but two finger typing makes it very slow and painful to write and often, when using the objects, intellisense gives you no clues as to what properties, methods, or child objects are available to you. It also makes it very laborious to debug.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;The Range(&amp;quot;C1&amp;quot;)... is also very dangerous as if you have multiple workbooks open, or your workbook has multiple worksheets, you may find that Range(&amp;quot;C1&amp;quot;)... does not refer to the C1 you think it does as your code may have made another workbook active. (Remember, you are just using ActiveWorkbook).&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Now consider this code, which does the same.&lt;/div&gt;
&lt;p&gt;
&lt;div&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;Sub&lt;/span&gt; Demo()
&lt;span style="color:#0000ff;"&gt;Dim&lt;/span&gt; wb &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; Workbook
&lt;span style="color:#0000ff;"&gt;Dim&lt;/span&gt; wks &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; Worksheet

&lt;span style="color:#0000ff;"&gt;Set&lt;/span&gt; wb = ActiveWorkbook
&lt;span style="color:#0000ff;"&gt;Set&lt;/span&gt; wks = wb.Worksheets(&lt;span style="color:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;)

&lt;span style="color:#0000ff;"&gt;With&lt;/span&gt; Application
    .ScreenUpdating = &lt;span style="color:#0000ff;"&gt;False&lt;/span&gt;
    .EnableEvents = &lt;span style="color:#0000ff;"&gt;False&lt;/span&gt;
    
    &lt;span style="color:#0000ff;"&gt;With&lt;/span&gt; wks
        .Name = &lt;span style="color:#006080;"&gt;&amp;quot;Data&amp;quot;&lt;/span&gt;
        .Range(&lt;span style="color:#006080;"&gt;&amp;quot;A1&amp;quot;&lt;/span&gt;).Value = &lt;span style="color:#006080;"&gt;&amp;quot;Nick&amp;quot;&lt;/span&gt;
        .Range(&lt;span style="color:#006080;"&gt;&amp;quot;B1&amp;quot;&lt;/span&gt;).Value = &lt;span style="color:#006080;"&gt;&amp;quot;Hodge&amp;quot;&lt;/span&gt;
        .Range(&lt;span style="color:#006080;"&gt;&amp;quot;C1&amp;quot;&lt;/span&gt;).Value = .Range(&lt;span style="color:#006080;"&gt;&amp;quot;A1&amp;quot;&lt;/span&gt;).Value &amp;amp; &lt;span style="color:#006080;"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &amp;amp; .Range(&lt;span style="color:#006080;"&gt;&amp;quot;B1&amp;quot;&lt;/span&gt;).Value
    &lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;With&lt;/span&gt;
    
    .ScreenUpdating = &lt;span style="color:#0000ff;"&gt;True&lt;/span&gt;
    .EnableEvents = &lt;span style="color:#0000ff;"&gt;True&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;With&lt;/span&gt;

&lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;First you will notice we declare two variables (wb and wks (could be anything really)) to &amp;#39;carry&amp;#39; the two objects (the Workbook and the Worksheet respectively). In VBA, if you have an &amp;#39;Object&amp;#39; variable you have to &amp;#39;Set&amp;#39; it (unlike &amp;#39;value&amp;#39; variables which can just be assigned e.g. myVal=0) and we do this by using the ActiveWorkbook (hopefully we are sure that the activeworkbook is the correct one at this point!) and then we &amp;#39;Set&amp;#39; the Worksheet object variable by assigning the Sheet1 worksheet. (Note that I am using wb in front of this assignment. That&amp;#39;s because I &lt;u&gt;know&lt;/u&gt; that wb refers to the correct workbook).&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;What I am sure of now is that whatever I do with wb or wks will &lt;u&gt;always&lt;/u&gt; refer to those two objects. Whatever&amp;#39;s active, without activating them and without selecting. Your code will run quicker and there will be no screen flashing (hence I really have no need for the Application. ScreenUpdating, etc).&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;The second and third benefits of this approach are that I now only refer to Workbook.Worksheets(&amp;quot;Sheet1&amp;quot;) as wks and, while typing wks and the period to use properties and methods of the Worksheet, I am sure to get a &amp;#39;clue&amp;#39; from the VBE&amp;#39;s intellisense, as below. This does not always happen when using full notation as VBA seems to lose track of the object it is using. By declaring it in a &amp;#39;strong typed&amp;#39; way, it knows and guides you through.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/intellisense_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="216" alt="intellisense" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/intellisense_5F00_thumb.jpg" width="351" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;The last construct that I use all the time is the With...End With block. This gives you a further shortcut when you intend to make a lot of changes to a single object, (I also use it to make changes to objects &amp;#39;around&amp;#39; the referenced one, see Offset(...) below)&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;Option&lt;/span&gt; Explicit

&lt;span style="color:#0000ff;"&gt;Sub&lt;/span&gt; Demo()
&lt;span style="color:#0000ff;"&gt;Dim&lt;/span&gt; wb &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; Workbook
&lt;span style="color:#0000ff;"&gt;Dim&lt;/span&gt; wks &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; Worksheet
&lt;span style="color:#0000ff;"&gt;Dim&lt;/span&gt; rng &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; Range

&lt;span style="color:#0000ff;"&gt;Set&lt;/span&gt; wb = ActiveWorkbook
&lt;span style="color:#0000ff;"&gt;Set&lt;/span&gt; wks = wb.Worksheets(&lt;span style="color:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;)
&lt;span style="color:#0000ff;"&gt;Set&lt;/span&gt; rng = wks.Range(&lt;span style="color:#006080;"&gt;&amp;quot;A1&amp;quot;&lt;/span&gt;)

&lt;span style="color:#0000ff;"&gt;With&lt;/span&gt; Application
    .ScreenUpdating = &lt;span style="color:#0000ff;"&gt;False&lt;/span&gt;
    .EnableEvents = &lt;span style="color:#0000ff;"&gt;False&lt;/span&gt;
    
wks.Name = &lt;span style="color:#006080;"&gt;&amp;quot;Data&amp;quot;&lt;/span&gt;
    
    &lt;span style="color:#0000ff;"&gt;With&lt;/span&gt; rng
        .Value = &lt;span style="color:#006080;"&gt;&amp;quot;Nick&amp;quot;&lt;/span&gt;
        .Offset(0, 1).Value = &lt;span style="color:#006080;"&gt;&amp;quot;Hodge&amp;quot;&lt;/span&gt;
        .Offset(0, 2).Value = .Value &amp;amp; &lt;span style="color:#006080;"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &amp;amp; .Offset(0, 1).Value
        &lt;span style="color:#0000ff;"&gt;With&lt;/span&gt; .Font
            .Bold = &lt;span style="color:#0000ff;"&gt;True&lt;/span&gt;
            .Color = RGB(0, 0, 0)
        &lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;With&lt;/span&gt;
        .Interior.Color = RGB(255, 0, 0)
    &lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;With&lt;/span&gt;
    
    .ScreenUpdating = &lt;span style="color:#0000ff;"&gt;True&lt;/span&gt;
    .EnableEvents = &lt;span style="color:#0000ff;"&gt;True&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;With&lt;/span&gt;

&lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;You&amp;#39;ll notice we&amp;#39;ve added a rng variable, that refers to a Range object and then we &amp;#39;set&amp;#39; that to the range A1 on Sheet1 (using our wks variable that we &lt;u&gt;know&lt;/u&gt; refers to that sheet &lt;u&gt;in the ActiveWorkbook&lt;/u&gt; (wb)). We then use that rng object in a With...End With block to assign stuff to that object. (notice too I use an internal With...End With block to assign stuff to the Font object). You&amp;#39;ll also notice I moved the wks.Name line out of the block as it is no longer referring to the wks but the rng. Of course I could have incorporated the .Name into the rng block, by using&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;.Parent.Name=&amp;quot;Data&amp;quot;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;As the Worksheet (wks), is the &amp;#39;Parent&amp;#39; object of the Range (rng) object.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Maybe the image below will help to show the components parts.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/code-explanation_5F00_4.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="527" alt="code explanation" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/code-explanation_5F00_thumb_5F00_1.jpg" width="531" border="0" /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;That&amp;#39;s just a few pointers in what I do to make my code shorter, more readable, efficient and easier to debug. It also has the spin off in making the VBE tool work for you instead of against you.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Just my slant on things... Comments.&lt;/div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=2566" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/VBA/default.aspx">VBA</category></item><item><title>Alternative Pivot Tables</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/07/24/alternative-pivot-tables.aspx</link><pubDate>Thu, 24 Jul 2008 22:05:25 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:2488</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;As many of you know, I don&amp;#39;t do anything with technology &amp;#39;in earnest&amp;#39;, but love tinkering and it is great to have a &amp;#39;project&amp;#39; with a functional &amp;#39;end game&amp;#39;.&lt;/p&gt; &lt;p&gt;Recently, I have been a little &amp;#39;off&amp;#39; my usual Excel activity and developing (for fun) in the evening, on trains, etc, some additional reporting for our Company Intranet, using VB.Net, ASP.Net and SQL Server. (I had already done some, but it called an iSeries server in the US, from the UK and as it has become &lt;u&gt;very&lt;/u&gt; popular with staff I have decided to get the data onto a local SQL server and work it from there).&lt;/p&gt; &lt;p&gt;As an MVP I am lucky to be given an NFR licence for a great set of .Net controls from &lt;a href="http://www.devexpress.com/" target="_blank"&gt;DevExpress&lt;/a&gt; and during the development of this stuff I have used their &lt;a href="http://www.devexpress.com/Products/NET/Controls/ASP/Pivot_Grid/" target="_blank"&gt;ASPxPivotGrid&lt;/a&gt; control. The features of this thing are amazing and the developer story is excellent. Now, I&amp;#39;m not trying to put the Excel unit down, as that for intuition, usability, etc is excellent, particularly in it&amp;#39;s 2007 implementation, but let me run you down a few of the things this grid has that Excel could certainly do with.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Linked Fields&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The ability to join two or more fields together in a &amp;#39;group&amp;#39;. This feature ensures that fields which should be linked stay that way. For example a UserID and Name which should never be allowed separated. The small line, shown below, denotes they are a &amp;#39;group&amp;#39;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/pivotgrid_5F00_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="382" alt="pivotgrid" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/pivotgrid_5F00_thumb.jpg" width="415" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Multi-User&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Just by the fact this is a web control and sits on the server it works great in a multi-user environment, The second benefit to it using the server is the speed of refresh which will pretty well always be quicker on the server that any client.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Developer Restrictable Zones&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Each field can be set to show in all zones or only selected ones. This is great to stop a user adding days to the column area which can result in hundreds or thousands of columns, not too desirable. For example, &lt;a href="http://excelusergroup.org/Demo/PivotDemo.aspx" target="_blank"&gt;in the demo here&lt;/a&gt;, you cannot add the &amp;#39;Date&amp;#39; field to the &amp;#39;Value&amp;#39; or &amp;#39;Column&amp;#39; areas.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Single-Click Sorting&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Click on a header and the column or row are sorted ascending, click again and it&amp;#39;s done descending.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Paging&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;With the pager you can simply restrict the &amp;#39;depth&amp;#39; to which the data goes down. That&amp;#39;s an essential on the web, to keep stuff &amp;#39;above the fold&amp;#39;, but wouldn&amp;#39;t that be nice in excel too?&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/pager_5F00_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="383" alt="pager" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/pager_5F00_thumb.png" width="517" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Separate Field, DataField and Caption Properties&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;How often have you either had to &amp;#39;put up&amp;#39; with either a duff name in the data source, or the same in the Pivot Table itself as Excel allows only unique names in fields, so for example, OrderValue in the database, becomes say &amp;#39;Sum of OrderValue&amp;#39; in the table, it&amp;#39;s long and ugly, so you try just changing it in the P/T back to OrderValue and Bang! In this grid you can display the caption property, have another (or same) name for the DataField property and yet another as the fieldname to refer to in code.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Drag and Drop&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Using Ajax callbacks you can simply drag any field to any zone (if allowed by the developer) and when you see the little arrows, drop it and you field will appear there.&lt;/p&gt; &lt;p&gt;&lt;a href="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Draganddrop_5F00_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="198" alt="Draganddrop" src="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nickhodge/Draganddrop_5F00_thumb.jpg" width="417" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Obviously there are standard things like right click and collapse or expand a fields or all fields and filtering with a drop-down on what we would know as &amp;#39;page fields&amp;#39; in excel (now called report filters)&lt;/p&gt; &lt;p&gt;The demo does not have any formatting but there are tons of &amp;#39;skins&amp;#39; for it or you can use your own CSS. I&amp;#39;m not a design guy, more interested in the data, but I have it looking really attractive on our intranet.&lt;/p&gt; &lt;p&gt;As a developer story the possibilities are almost endless with so many &amp;#39;switches&amp;#39; on each column, the whole grid and events on the client (JavaScript) or the server (any .Net language).&lt;/p&gt; &lt;p&gt;I have to say, I was impressed with the Excel P/T and still am. I love them, but this has a great UI story and most importantly, a great developer one too. &lt;a href="http://excelusergroup.org/Demo/PivotDemo.aspx" target="_blank"&gt;Try out my basic demo using some (slightly weird) stats from this site (live)&lt;/a&gt; but go and look at the full potential at &lt;a href="http://demos.devexpress.com/ASPxPivotGridDemos/" target="_blank"&gt;their site&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Thank you DevExpress!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=2488" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Pivot+Tables/default.aspx">Pivot Tables</category></item><item><title>COUNTIF SUMIF Limitations</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/06/27/countif-sumif-limitations.aspx</link><pubDate>Fri, 27 Jun 2008 18:05:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:2378</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I&amp;#39;m sure many of you knew this but it was new to me and I came across it today, so in an effort to get it out there a bit more, i document it here.&lt;/p&gt;
&lt;p&gt;It concerns the fact that COUNTIF and SUMIF (and their 2007 plural counterparts SUMIFS and COUNTIFS) carry forward the limitation that Excel has of 15 significant digits. (As does 1-2-3 and OpenOffice)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/269370"&gt;http://support.microsoft.com/kb/269370&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I knew this limitation, but didn&amp;#39;t realise the two functions concerned followed this limit&amp;#39;&lt;/p&gt;
&lt;p&gt;I had to build an automated reconciliation model to delete off matching records. It operates through several iterations but my first one was to concatenate Date, Customer Number and Credit/Debit amount and then do a COUNTIF on that &amp;#39;Key&amp;#39;. If this resulted in 2, then I could presume a&amp;nbsp; &amp;#39;match&amp;#39; and delete the record.&lt;/p&gt;
&lt;p&gt;Imagine this then. I have data as the screenshot below&lt;/p&gt;
&lt;p&gt;&lt;img width="670" src="http://excelusergroup.org/blogs/nickhodge/08/06/CountifError.png" alt="COUNIF Error" height="130" /&gt;&lt;/p&gt;
&lt;p&gt;In D3 is the formula =A3&amp;amp;B3&amp;amp;C3&lt;br /&gt;In E3 (as you can see) is the formula =COUNTIF(D:D,D3)&lt;br /&gt;In F3 is effectively the same formula as in E3 but using the 2007 function COUNTIFS() (using just one criteria)&lt;br /&gt;In G3 is the formula =SUMIF(D:D,D3,C:C)&lt;br /&gt;In H3 is the formula =SUMIFS(C:C,D:D,D3) (Notice how in this 2007 version the parameter order is changed)&lt;br /&gt;In I3 is the formula =SUMPRODUCT(--($D$3:$D$4=D3))&lt;br /&gt;In J3 is the formula =SUMPRODUCT(($D$3:$D$4=D3)*($C$3:$C$4))&lt;/p&gt;
&lt;p&gt;What COUNTIF and SUMIF (and their plural Excel 2007 equivalents) are seeing is a string in both cells (D3 and D4) that are the same as they are just taking the first 15 digits (200806101234561). Plainly, in my scenario this is incorrect. SUMPRODUCT however sees all the digits and therefore overcomes this limitation. Correctly seeing a COUNT of 1 each and a SUM of just the single values.&lt;/p&gt;
&lt;p&gt;For a complete explanation of SUMPRODUCT you could do worse than look here&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.xldynamic.com/source/xld.SUMPRODUCT.html"&gt;http://www.xldynamic.com/source/xld.SUMPRODUCT.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BTW: As a sideline, the formula using SUMPRODUCT worked about twice as fast&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=2378" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/COUNTIF/default.aspx">COUNTIF</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/SUMIFS/default.aspx">SUMIFS</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/COUNTIFS/default.aspx">COUNTIFS</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/SUMIF/default.aspx">SUMIF</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/SUMPRODUCT/default.aspx">SUMPRODUCT</category></item><item><title>Summit in Seattle</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/04/14/summit-in-seattle.aspx</link><pubDate>Mon, 14 Apr 2008 12:45:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:1767</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;It&amp;#39;s been some time since I posted a blog post and this is a little lame when it comes to Excel, but we are all (MVPs) in Seattle at the Global Summit this week and if there is anything we are allowed to post under our NDAs I will try and post it here.&lt;/p&gt;
&lt;p&gt;Never know until we get there what will be allowed public domain and we have to be real careful, but I will certainly be pointing the Excel Team to the v.Next forum if you still have some ideas for that.&lt;/p&gt;
&lt;p&gt;Looking forward to a great week at the &amp;#39;Excel coal face&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=1767" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/MVP+Summit/default.aspx">MVP Summit</category></item><item><title>Playing with OpenAsTextStream</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/03/13/playing-with-openastextstream.aspx</link><pubDate>Thu, 13 Mar 2008 19:35:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:1238</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;We produce individual text files for new items to go into our catalogue. These are sent to the creative people for laying out on the page. One file contains the Item#, Description, Text and Bullets for one item and is named with that item&amp;#39;s number. Of course, for page layout it is good for them to copy and paste the text this way. It looks as below:&lt;/p&gt;
&lt;p&gt;12345E&lt;/p&gt;
&lt;p&gt;2500PSI 15LPM Petrol-Powered Pressure Washer&lt;/p&gt;
&lt;p&gt;This pressure washer, powered by a Honda GX160 engine, will blast away even the most stubborn dirt with ease. Supplied with reinforced rubber hose and lance with four interchangeable nozzles.&lt;br /&gt;* 2500PSI&lt;br /&gt;* 15 LPM&lt;br /&gt;* Comet Axial pump&lt;br /&gt;* Downstream Chemical Injector&lt;br /&gt;* Ship Wt: 68kg&lt;/p&gt;
&lt;p&gt;Of course, when it comes to the website, we need a much more formal record/field (row/column) structure. The challenge today was to parse the files (iterating over a folder containing the files), which also have random blank lines into a sensible structure in Excel for uploading onto the web. Whilst not in my job description, it was a challenge I wanted to take as it was a long time since I worked with text files and I don&amp;#39;t think I&amp;#39;ve ever worked with the FileSystem object from the Microsoft Scripting Runtime Library.&lt;/p&gt;
&lt;p&gt;Of course, with any parsing job, the data is never straightforward. I&amp;#39;ve already mentioned the blank lines, but they also wanted the * changed to &amp;lt;li&amp;gt; to create an html bullet and the Ship Wt: line stripped off as that has it&amp;#39;s own field. The split was across three rows, containing Item#, Item Title and Web Text.&lt;/p&gt;
&lt;p&gt;When coding I always prefer to use early binding, where you manually set a reference via the VBE to the library you want to use, in this case the Microsoft Scripting Runtime. I do this as it gives you the advantage of intellisense if you are not sure of the object, methods, etc. So my code at development time would look like this&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; ParseFile()
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; fsys &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; FileSystemObject, fsfile &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; File, stream &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; TextStream

    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Set FileSystemObject variables (Early binding)&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; fsys = &lt;span style="COLOR:#0000ff;"&gt;New&lt;/span&gt; FileSystemObject
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; fsfile = fsys.GetFile(sFolderName &amp;amp; sParseFile)
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; stream = fsfile.OpenAsTextStream(1, 0)

&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This way, just typing fsys. in the future code will fire up the properties, methods, etc of the FileSystemObject, very handy when you don&amp;#39;t know them. Generally though I find deploying early binding is a pain, as you have to remember to set the reference on each machine before running the code, so at runtime I change the variable types to generic &amp;#39;Objects&amp;#39; and then use the CreatObject function to create the FileSytemObject as below&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; ParseFile()
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; fsys &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Object&lt;/span&gt;, fsfile &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Object&lt;/span&gt;, stream &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Object&lt;/span&gt;

    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Set FileSystemObject variables (Late binding)&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; fsys = CreateObject(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Scripting.FileSystemObject&amp;quot;&lt;/span&gt;)
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; fsfile = fsys.GetFile(sFolderName &amp;amp; sParseFile)
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; stream = fsfile.OpenAsTextStream(1, 0)

&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The OpenAsTextStream method of the File object is very nice to use, you can either read or write the file, you can check each character, complete lines or all the text at once. You get AtEndOfLine and AtEndOfStream boolean properties of the stream object so you can process until one and/or both of these properties are true.&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m making no claims for quality of coding, but the below is the full, deployed code that works for the files we produce. In testing too, it parsed the data from 150 txt files into the correct columns and rows in just a few seconds, much faster than the old copy and paste!&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:600px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;HEIGHT:379px;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;Option&lt;/span&gt; Explicit

&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; ParseFile()
&lt;span style="COLOR:#008000;"&gt;&amp;#39;**************************************************************************&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39; Code written by Nick Hodge 12th March 2008&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;V1.0 into production same day. versions below.&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;V1.1 added error handling and check for file name ending in &amp;#39;E&amp;#39; (13/3/2007)&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;V1.2 added checking for * as first character of line and change it to &amp;lt;li&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;for an html bullet, also strip out line starting Ship Wt. (13/3/2007)&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;**************************************************************************&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Navigate to a folder and the code will iterate over any text files taking the first&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;line with text in it and assigning it to the strLine1 variable. It does the same for&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;second and third lines and then assigns them to columns 1, 2, 3 in a new workbook&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;laying them out in proper field/record format for importing to web&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;File format should have item number as first line (no matter if blank lines above&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Product title on second line, no matter if blanks above and rest of copy after that&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;File and folder name variables&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; sFullPathFilename &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;, sFolderName &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;, sParseFile &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;New workbook and worksheet variables&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; wb &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; Workbook, wks &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; Worksheet
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Counter to count iterations, used in row placement on sheet and counter for postion&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;of slash in path name (before filename)&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; lCounter &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Long&lt;/span&gt;, lSlashPosition &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Long&lt;/span&gt;, iwksCount &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Integer&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Filesytem object variables to hold file, textstream, etc.&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; fsys &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; FileSystemObject, fsfile &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; File, stream &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; TextStream
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Variable to hold lines of text for later assignment to worksheet&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; strLine1 &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;, strLine2 &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;, strLine3 &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;, strTemp &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Booleans to stop loop after line 1 found, etc.&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; bLine1Fnd &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Boolean&lt;/span&gt;, bLine2Fnd &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Boolean&lt;/span&gt;

&lt;span style="COLOR:#0000ff;"&gt;On&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Error&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;GoTo&lt;/span&gt; errHandler

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Get folder to use by clicking on file&lt;/span&gt;
sFullPathFilename = Application.GetOpenFilename(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Text Files, *.txt&amp;quot;&lt;/span&gt;, , &lt;span style="COLOR:#006080;"&gt;&amp;quot;Select any file in the folder&amp;quot;&lt;/span&gt;)

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Check to see selection made&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; sFullPathFilename = &lt;span style="COLOR:#006080;"&gt;&amp;quot;False&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
    MsgBox &lt;span style="COLOR:#006080;"&gt;&amp;quot;You must click on any file in the folder&amp;quot;&lt;/span&gt;, vbOKOnly, &lt;span style="COLOR:#006080;"&gt;&amp;quot;No Folder Selected&amp;quot;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Exit&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Get position of last slash and parse folder from this&lt;/span&gt;
lSlashPosition = InStrRev(sFullPathFilename, &lt;span style="COLOR:#006080;"&gt;&amp;quot;\&amp;quot;&lt;/span&gt;, -1)
&lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; lSlashPosition = 0 &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
    MsgBox &lt;span style="COLOR:#006080;"&gt;&amp;quot;We cannot recognise the folder name, exiting procedure&amp;quot;&lt;/span&gt;, vbOKOnly + vbExclamation, &lt;span style="COLOR:#006080;"&gt;&amp;quot;Error&amp;quot;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Exit&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Open workbook and set variables&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; wb = Workbooks.Add
&lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; wks = wb.Worksheets(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;)

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Change sheet name&lt;/span&gt;
wks.Name = &lt;span style="COLOR:#006080;"&gt;&amp;quot;Data&amp;quot;&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Switch off application events&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt; Application
    .ScreenUpdating = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
    .DisplayAlerts = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
   
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Delete surplus worksheets&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt; wb
    &lt;span style="COLOR:#0000ff;"&gt;For&lt;/span&gt; iwksCount = .Worksheets.Count &lt;span style="COLOR:#0000ff;"&gt;To&lt;/span&gt; 1 &lt;span style="COLOR:#0000ff;"&gt;Step&lt;/span&gt; -1
        &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; .Worksheets(iwksCount).Name &amp;lt;&amp;gt; &lt;span style="COLOR:#006080;"&gt;&amp;quot;Data&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
        .Worksheets(iwksCount).Delete
        &lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Next&lt;/span&gt; iwksCount
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Set headings and bold&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt; wks
    .Range(&lt;span style="COLOR:#006080;"&gt;&amp;quot;A1&amp;quot;&lt;/span&gt;).Value = &lt;span style="COLOR:#006080;"&gt;&amp;quot;ItemNo&amp;quot;&lt;/span&gt;
    .Range(&lt;span style="COLOR:#006080;"&gt;&amp;quot;B1&amp;quot;&lt;/span&gt;).Value = &lt;span style="COLOR:#006080;"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;
    .Range(&lt;span style="COLOR:#006080;"&gt;&amp;quot;C1&amp;quot;&lt;/span&gt;).Value = &lt;span style="COLOR:#006080;"&gt;&amp;quot;WebText&amp;quot;&lt;/span&gt;
    .Rows(&lt;span style="COLOR:#006080;"&gt;&amp;quot;1:1&amp;quot;&lt;/span&gt;).Font.Bold = &lt;span style="COLOR:#0000ff;"&gt;True&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt;

sFolderName = Left(sFullPathFilename, lSlashPosition)

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Start iteration of folder using folder name and files ending in E.txt&lt;/span&gt;
sParseFile = Dir(sFolderName &amp;amp; &lt;span style="COLOR:#006080;"&gt;&amp;quot;*E.txt&amp;quot;&lt;/span&gt;)

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Intialise counter to 2 which starts it on second row, below titles&lt;/span&gt;
lCounter = 2

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Do for each file Dir function is called recursively and returns &amp;quot;&amp;quot; when no more files match&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Do&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;While&lt;/span&gt; sParseFile &amp;lt;&amp;gt; &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Initialise booleans&lt;/span&gt;
bLine1Fnd = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
bLine2Fnd = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;

    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Set FileSystemObject variables (Late binding)&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; fsys = CreateObject(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Scripting.FileSystemObject&amp;quot;&lt;/span&gt;)
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; fsfile = fsys.GetFile(sFolderName &amp;amp; sParseFile)
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; stream = fsfile.OpenAsTextStream(1, 0)

    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Do so long as the endoffile marker is false, sets first line of text&lt;/span&gt;
    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Accounts for blank lines&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Do&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;While&lt;/span&gt; stream.AtEndOfStream = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
            &lt;span style="COLOR:#0000ff;"&gt;Do&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;While&lt;/span&gt; bLine1Fnd = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
            strTemp = stream.ReadLine
                &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; strTemp &amp;lt;&amp;gt; &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
                    strLine1 = strTemp
                    bLine1Fnd = &lt;span style="COLOR:#0000ff;"&gt;True&lt;/span&gt;
                    strTemp = &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;
                &lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;
            &lt;span style="COLOR:#0000ff;"&gt;Loop&lt;/span&gt;
            &lt;span style="COLOR:#008000;"&gt;&amp;#39;sets second line of text, accounts for blank lines&lt;/span&gt;
            &lt;span style="COLOR:#0000ff;"&gt;Do&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;While&lt;/span&gt; bLine2Fnd = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
            strTemp = stream.ReadLine
                &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; strTemp &amp;lt;&amp;gt; &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
                    strLine2 = strTemp
                    bLine2Fnd = &lt;span style="COLOR:#0000ff;"&gt;True&lt;/span&gt;
                    strTemp = &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;
                &lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;
            &lt;span style="COLOR:#0000ff;"&gt;Loop&lt;/span&gt;
            &lt;span style="COLOR:#008000;"&gt;&amp;#39;Once 1st and 2nd lines are full then take averything else, line by line&lt;/span&gt;
            strTemp = stream.ReadLine
            &lt;span style="COLOR:#008000;"&gt;&amp;#39;Check if line is ship wt., if so discard&lt;/span&gt;
                &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; Left(UCase(strTemp), 6) = &lt;span style="COLOR:#006080;"&gt;&amp;quot;* SHIP&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt; strTemp = &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;
                &lt;span style="COLOR:#008000;"&gt;&amp;#39;Build 3rd lines changing * to &amp;lt;li&amp;gt; for html bullet, else just add the next line to the copy&lt;/span&gt;
                &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; strTemp &amp;lt;&amp;gt; &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
                    &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; Left(strTemp, 1) = &lt;span style="COLOR:#006080;"&gt;&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
                        strTemp = &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;lt;li&amp;gt;&amp;quot;&lt;/span&gt; &amp;amp; Mid(strTemp, 2, Len(strTemp) - 1)
                        strLine3 = strLine3 &amp;amp; strTemp &amp;amp; Chr(10)
                    &lt;span style="COLOR:#0000ff;"&gt;Else&lt;/span&gt;
                        strLine3 = strLine3 &amp;amp; strTemp &amp;amp; Chr(10)
                    &lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;
                &lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;
                
    &lt;span style="COLOR:#0000ff;"&gt;Loop&lt;/span&gt;
    
    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Close stream and release object variables&lt;/span&gt;
    stream.Close

    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; stream = &lt;span style="COLOR:#0000ff;"&gt;Nothing&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; fsfile = &lt;span style="COLOR:#0000ff;"&gt;Nothing&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;Set&lt;/span&gt; fsys = &lt;span style="COLOR:#0000ff;"&gt;Nothing&lt;/span&gt;
    
    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Assign the strings to worksheet&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt; wks
        .Cells(lCounter, 1).Value = strLine1
        .Cells(lCounter, 2).Value = strLine2
        .Cells(lCounter, 3).Value = Left(strLine3, Len(strLine3) - 1)
        .Columns.AutoFit
        .Columns(3).ColumnWidth = 200
        .Rows.AutoFit
    &lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt;
    
    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Clear strings for next iteration&lt;/span&gt;
    strLine1 = &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;
    strLine2 = &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;
    strLine3 = &lt;span style="COLOR:#006080;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;
    
    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Increment counter so text is placed on next row&lt;/span&gt;
    lCounter = lCounter + 1

    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Start next iteration of files in folder&lt;/span&gt;
    sParseFile = Dir()

&lt;span style="COLOR:#0000ff;"&gt;Loop&lt;/span&gt;
    
    &lt;span style="COLOR:#008000;"&gt;&amp;#39;Turn application events back on&lt;/span&gt;
    .ScreenUpdating = &lt;span style="COLOR:#0000ff;"&gt;True&lt;/span&gt;
    .DisplayAlerts = &lt;span style="COLOR:#0000ff;"&gt;True&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt;

MsgBox &lt;span style="COLOR:#006080;"&gt;&amp;quot; Successfully parsed &amp;quot;&lt;/span&gt; &amp;amp; lCounter - 2 &amp;amp; &lt;span style="COLOR:#006080;"&gt;&amp;quot; *.txt files&amp;quot;&lt;/span&gt; &amp;amp; Chr(13) &amp;amp; &lt;span style="COLOR:#006080;"&gt;&amp;quot;From &amp;quot;&lt;/span&gt; &amp;amp; sFolderName, _
    vbInformation + vbOKOnly, &lt;span style="COLOR:#006080;"&gt;&amp;quot;Parsed Successfully&amp;quot;&lt;/span&gt;

&lt;span style="COLOR:#0000ff;"&gt;Exit&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Error handling routine to exit gracefully&lt;/span&gt;
errHandler:

MsgBox &lt;span style="COLOR:#006080;"&gt;&amp;quot;There has been an error, please advise add-in creator&amp;quot;&lt;/span&gt; &amp;amp; Chr(13) &amp;amp; _
    &lt;span style="COLOR:#006080;"&gt;&amp;quot;The routine failed on: &amp;quot;&lt;/span&gt; &amp;amp; sParseFile, vbOKOnly + vbCritical

&lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Not&lt;/span&gt; wb &lt;span style="COLOR:#0000ff;"&gt;Is&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
    wb.Close SaveChanges:=&lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;

&lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt; Application
    .DisplayAlerts = &lt;span style="COLOR:#0000ff;"&gt;True&lt;/span&gt;
    .ScreenUpdating = &lt;span style="COLOR:#0000ff;"&gt;True&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt;

&lt;span style="COLOR:#0000ff;"&gt;Exit&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;

&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you want to download and try the file &lt;font color="#ff0000"&gt;&lt;strong&gt;(Excel 2007 Only)&lt;/strong&gt;&lt;/font&gt;&amp;nbsp;I have attached the working xlsm file to this post&amp;nbsp;(It is actually deployed as an xlam add-in) and 20 demo text files. Just place the text files in a folder and then go to the Marketing tab (Yes, I even wrote a ribbon customisation for it!) and press the button. It will ask you to navigate to any file in the folder and the will take each file in turn using the Dir() function and parse the text into a new Excel workbook.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=1238" width="1" height="1"&gt;</description><enclosure url="http://excelusergroup.org/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.00.12.38/ParseTextFiles.zip" length="33890" type="application/x-zip-compressed" /><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Parse+Text+Files/default.aspx">Parse Text Files</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/FileSystemObject/default.aspx">FileSystemObject</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Scripting/default.aspx">Scripting</category></item><item><title>Questions on customising the ribbon</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/03/02/questions-on-customising-the-ribbon.aspx</link><pubDate>Sun, 02 Mar 2008 10:52:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:1105</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>14</slash:comments><description>&lt;p&gt;I have, via the blog contact form received three questions from Milan, these were&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Can you remove the Office Button?&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Can you link a combobox (on the ribbon) to a cell/range?&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Can you link a label (on the ribbon) to a cell?&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;The answer to No.1 was answered in the &lt;a class="" title="Customise the Ribbon Part 2" href="http://excelusergroup.org/blogs/nickhodge/archive/2008/01/31/ribbon-step-by-step-part-2-begin-customisation.aspx" target="_blank"&gt;2nd of my series on customising&lt;/a&gt; the ribbon. In the section under Full Dictator Application.&lt;/p&gt;
&lt;p&gt;No. 2 is yes you very much can but it is not a simple process like having a &amp;#39;link&amp;#39; property or similar. The write-up below demonstrates how you would take a range of cells (BoxList @&amp;nbsp;$A$!:$A$10)&amp;nbsp;to fill the combobox and then display the selected item in a cell on the worksheet ($D$1).&lt;/p&gt;
&lt;p&gt;A comboBox has a DropDown (so is similar to a dropDown ribbon control), but allows extra entries to be typed in at runtime.&lt;/p&gt;
&lt;p&gt;The first thing we need to do is set up the RibbonX in the file (&lt;a class="" href="http://excelusergroup.org/blogs/nickhodge/archive/2008/01/31/ribbon-step-by-step-part-2-begin-customisation.aspx" target="_blank"&gt;for detail, see here&lt;/a&gt;). For this demo I am setting startFromScratch=&amp;quot;true&amp;quot;, so all we should have from the below RibbonX is a single tab, with one group and one comboBox. Notice too, that at this stage the comboBox is empty. This is because we will be building this when the workbook opens, using a Workbook_Open() event&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
            &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tab&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;myTab1&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Demo Tab&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;group&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Group1&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Combobox&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;comboBox&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Combobox1&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Cell Link&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;getItemID&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;cmb_getItemID&amp;quot;&lt;/span&gt;
                        &lt;span style="COLOR:#ff0000;"&gt;getItemLabel&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;cmb_getItemLabel&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;getItemCount&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;cmb_itemCount&amp;quot;&lt;/span&gt; 
                            &lt;span style="COLOR:#ff0000;"&gt;onChange&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;cmb_onChange&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;group&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tab&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Notice that we are using four &amp;#39;callback&amp;#39; attributes to populate the comboBox and to &amp;#39;link&amp;#39; it to a cell. These are used for the following reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;getItemID() = Used to &amp;#39;set&amp;#39; the unique ID necessary for every control on the ribbon (It is tough to think that the names &amp;#39;getxxx&amp;#39; are actually better though of as &amp;#39;set&amp;#39;. It is meaning the Ribbon needs to &amp;#39;get&amp;#39; rather than you need to &amp;#39;set&amp;#39; if that makes sense?)&lt;/li&gt;
&lt;li&gt;getItemLabel() = Used to &amp;#39;set&amp;#39; the text of each item displayed in the control&lt;/li&gt;
&lt;li&gt;getItemCount() = Used to &amp;#39;set&amp;#39; the number of items the control should expect to display.&lt;/li&gt;
&lt;li&gt;onChange()= Used to provide the &amp;#39;link&amp;#39; to a cell on the worksheet. This fires each time the control is changed.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Next we generate the callback signatures for these by pressing the button in the Custom UI Editor. &lt;font color="#ff0000"&gt;You will notice below&amp;nbsp;that the UI editor does not generate a getItemID callback. this is a bug, the signature is given below to help you.&lt;/font&gt;&lt;/p&gt;&lt;font color="#000000"&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Combobox1 getItemID (NOT GIVEN BY CALLBACK GENERATOR)&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; cmb_getItemID(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, index &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Integer&lt;/span&gt;, &lt;span style="COLOR:#0000ff;"&gt;ByRef&lt;/span&gt; ID)
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Combobox1 getItemLabel&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; cmb_getItemLabel(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, index &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Integer&lt;/span&gt;, &lt;span style="COLOR:#0000ff;"&gt;ByRef&lt;/span&gt; returnedVal)
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Combobox1 getItemCount&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; cmb_itemCount(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, &lt;span style="COLOR:#0000ff;"&gt;ByRef&lt;/span&gt; returnedVal)
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt;

&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Combobox1 onChange&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; cmb_onChange(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, text &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;)
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We will use a Workbook_Open() event to build the array of items to load into the control. This event, as the name implies, fires when the workbook is opened. It is placed in the &amp;#39;ThisWorkbook&amp;quot; module.&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;Option&lt;/span&gt; Explicit
&lt;span style="COLOR:#008000;"&gt;&amp;#39;There are two global variables at the top of a standard module&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;iItemcount and vRngValues&lt;/span&gt;

&lt;span style="COLOR:#0000ff;"&gt;Private&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; Workbook_Open()
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Counter variable&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Dim&lt;/span&gt; x &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Integer&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Counts the cells in the range, used later to set no. of Items in control.&lt;/span&gt;
iItemcount = Worksheets(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;).Range(&lt;span style="COLOR:#006080;"&gt;&amp;quot;BoxList&amp;quot;&lt;/span&gt;).Cells.Count - 1
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Re-Dimension the dynamic array to it&amp;#39;s actual size.&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;ReDim&lt;/span&gt; vRngValues(iItemcount)
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Build the array&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;For&lt;/span&gt; x = 0 &lt;span style="COLOR:#0000ff;"&gt;To&lt;/span&gt; iItemcount
    vRngValues(x) = Worksheets(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;).Cells(1 + x, 1).Value
&lt;span style="COLOR:#0000ff;"&gt;Next&lt;/span&gt; x
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now we will have the range &amp;#39;BoxList&amp;#39; assigned to a one-dimensional array and the count of items, in public variables available to all code in the project. (remember this for later)&lt;/p&gt;
&lt;p&gt;First let&amp;#39;s advise the control how many items we will need in the control, using the global integer variable iItemcount (built in the Workbook_Open() event)&amp;nbsp;and the getItemCount() callback, as below. (The comments explain what the procedure does, in fact we are using just one line of code!). These callbacks are all placed in a standard module.&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Combobox1 getItemCount&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; cmb_itemCount(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, &lt;span style="COLOR:#0000ff;"&gt;ByRef&lt;/span&gt; returnedVal)
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Use the global variable collected in the Workbook_Open()&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;assigning it to the returnedVal parameter&lt;/span&gt;
    returnedVal = iItemcount
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next, as each item in the control (and the control itself for that matter) need a unique ID we will build this next using the getItemID callback, as below. Again the comments explain what is happening.&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Combobox1 getItemID&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; cmb_getItemID(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, index &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Integer&lt;/span&gt;, &lt;span style="COLOR:#0000ff;"&gt;ByRef&lt;/span&gt; ID)
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Set the ID parameter in the callback signature to each &amp;#39;index&amp;#39;&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;in the signature. We are adding cmbBox text to make it unique&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;as using just a number may clash with other controls/items&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;indexes in controls are zero based&lt;/span&gt;
    ID = &lt;span style="COLOR:#006080;"&gt;&amp;quot;cmbBox&amp;quot;&lt;/span&gt; &amp;amp; index
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next we will write the last piece of code to actually build it (the fourth will be used as we use the control). This is the getItemLabel callback (below)&amp;nbsp;that &amp;#39;sets&amp;#39; the actual text that will be displayed in the combobox. (Again, just one line of code!)&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Combobox1 getItemLabel&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; cmb_getItemLabel(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, index &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Integer&lt;/span&gt;, &lt;span style="COLOR:#0000ff;"&gt;ByRef&lt;/span&gt; returnedVal)
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Sets the returnVal parameter, which carries the text back to the control&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;This fires for each control &amp;#39;item&amp;#39;, so the &amp;#39;index&amp;#39; parameter&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;provides a zero based index for the current item, which we use in the code&lt;/span&gt;
    returnedVal = vRngValues(index)
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Lastly, we will use the onChange() callback to assign the selected option from the comboBox, to a cell (D1) on our worksheet.&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Combobox1 onChange&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; cmb_onChange(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, text &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;String&lt;/span&gt;)
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Set the &amp;#39;text&amp;#39; parameter to a cell value&lt;/span&gt;
    Worksheets(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;).Range(&lt;span style="COLOR:#006080;"&gt;&amp;quot;D1&amp;quot;&lt;/span&gt;).Value = text
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&amp;#39;s all you need, job done! The image below shows the result.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://excelusergroup.org/blogs/nickhodge/08/03/02/comboboxresult.png"&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/03/02/comboboxresult.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Lastly, question No.3. I am hoping that the questioner was referring to the labelControl. This is used simply as a textual control that can act as a label&amp;nbsp;to anything else on a group. If so then yes, all we need to do is set the control&amp;#39;s getLabel attribute using it&amp;#39;s callback. I have added the ribbonX to the previous example, (it&amp;#39;s just one line) and the callback, added to a standard module is below that, which picks up the value from D2.&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
            &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tab&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;myTab1&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Demo Tab&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;group&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Group1&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Combobox&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;comboBox&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Combobox1&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Cell Link&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;getItemID&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;cmb_getItemID&amp;quot;&lt;/span&gt;
                        &lt;span style="COLOR:#ff0000;"&gt;getItemLabel&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;cmb_getItemLabel&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;getItemCount&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;cmb_itemCount&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;onChange&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;cmb_onChange&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;labelControl&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;myLabel&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;getLabel&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;lbl_getLabel&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;group&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tab&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The getLabel VBA callback&lt;/p&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:Consolas, &amp;#39;Courier New&amp;#39;, Courier, Monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for myLabel getLabel&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; lbl_getLabel(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, &lt;span style="COLOR:#0000ff;"&gt;ByRef&lt;/span&gt; returnedVal)
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Assigns the value in cell D2 to the returnVal parameter&lt;/span&gt;
    returnedVal = Worksheets(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;).Range(&lt;span style="COLOR:#006080;"&gt;&amp;quot;D2&amp;quot;&lt;/span&gt;).Value
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;
&lt;p&gt;The resulting label from cell D2&lt;/p&gt;
&lt;p&gt;&lt;a href="http://excelusergroup.org/blogs/nickhodge/08/03/02/labelcontrol.png"&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/03/02/labelcontrol.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Hopefully this goes someway to answering the OP questions and helps to further everyone&amp;#39;s understanding of customising the Ribbon in Office 2007.&lt;/p&gt;
&lt;p&gt;More to come.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=1105" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/RibbonX/default.aspx">RibbonX</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Excel+2007/default.aspx">Excel 2007</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/comboBox/default.aspx">comboBox</category></item><item><title>Maybe faulting add-ins are a thing of the past?</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/02/22/maybe-faulting-add-ins-are-a-thing-of-the-past.aspx</link><pubDate>Fri, 22 Feb 2008 09:12:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:1032</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I was intrigued to see, under the threat from competition commissions around the World, that Microsoft are opening up parts of their code-base and engineering to competitors to make the whole operating system and main applications (Office is mentioned), work better with 3rd party products.&lt;/p&gt;
&lt;p&gt;I for one hope people like Adobe gets involved with this as a good proportion of the posts in the public GrashesGPFs group on MSFT&amp;#39;s servers, relates to faulting add-ins opening with Excel.&lt;/p&gt;
&lt;p&gt;Hopefully good news?&lt;/p&gt;
&lt;p&gt;Here is the article from Reuters.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://uk.reuters.com/article/technologyNews/idUKWNAS191120080222?feedType=nl&amp;amp;feedName=ukmorningdigest"&gt;http://uk.reuters.com/article/technologyNews/idUKWNAS191120080222?feedType=nl&amp;amp;feedName=ukmorningdigest&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=1032" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Add-Ins/default.aspx">Add-Ins</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>Ribbon, Step-by-Step. Part 4 (Exploring Other Controls)</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/02/14/ribbon-step-by-step-part-4-exploring-other-controls.aspx</link><pubDate>Thu, 14 Feb 2008 23:56:36 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:968</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>30</slash:comments><description>&lt;p&gt;So we&amp;#39;ve explored the file formats, created the shell for a dictator application, made some basic ribbon, tab, group and control changes and customised the Office menu. We&amp;#39;ve re-purposed some Microsoft controls to our own use and now we will be running at pace through some of the other controls available to you. I doubt we will cover all of them, but you can &lt;a href="http://excelusergroup.org/files/folders/2007wb/entry212.aspx" target="_blank"&gt;download a bunch of my files here&lt;/a&gt;, which demonstrate more of what you are learning here and also contain a &amp;#39;popular&amp;#39; control and attribute listing. So...let&amp;#39;s get started.&lt;/p&gt; &lt;h3&gt;The Core Of Our Model&lt;/h3&gt; &lt;p&gt;As usual we will start with our basic building blocks of declaring a customUI and the ribbon itself, it&amp;#39;s startFromScratch attribute and a custom tab, which we will place after the built-in add-ins tab, like so:&lt;/p&gt; &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onLoad&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;loadRibbon&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;myTab1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Nick&amp;#39;s Tab&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;insertAfterMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;TabAddIns&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Z&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Notice that for the first time we have used the onLoad attribute of the customUI which will fire the callback VBA called loadRibbon. This will enable us to capture the ribbon object and change stuff later &amp;#39;on the fly&amp;#39; by invalidating it.&lt;/p&gt;
&lt;p&gt;Hopefully by now you are able to read and understand this basic format that makes the core of any customisation, remember, you must have an id for every control, within a collection, (remember the ribbon can only be singular, so doesn&amp;#39;t need one), and this must be unique in your project and either is a custom (created by you) id, or a built-in (created by Microsoft) idMso. You will find this rule throughout your customisations, for example, above we use insertAfterMso meaning insert this tab after the built-in &amp;#39;add-ins&amp;#39; one.&lt;/p&gt;
&lt;h3&gt;Adding A Group and Button&lt;/h3&gt;
&lt;p&gt;To the same code above, we can add our first custom group with a custom button. This button has it&amp;#39;s own onAction callback to VBA to handle the code when the button is pressed. The code at this stage is as below:&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onLoad&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;loadRibbon&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;myTab1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Nick&amp;#39;s Tab&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;insertAfterMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;TabAddIns&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Z&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;A&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 1&amp;quot;&lt;/span&gt; 
                &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;OpenFileButton&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the screentip of button1&amp;quot;&lt;/span&gt; 
                    &lt;span style="color:#ff0000;"&gt;size&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;large&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;supertip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the supertip of button1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
         &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;A&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 1&amp;quot;&lt;/span&gt; 
                &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;OpenFileButton&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the screentip of button1&amp;quot;&lt;/span&gt; 
                    &lt;span style="color:#ff0000;"&gt;size&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;large&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;supertip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the supertip of button1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
         &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The group has an id, is visible and has a label, which is the description that sits at the bottom on the group, as the below image of our &amp;#39;growing tab shows. Hopefully you can also pick the other &amp;#39;bits&amp;#39; from the code that created it, e.g. The tab label, where it&amp;#39;s positioned, the size of the button, (large), that we have &amp;#39;nicked&amp;#39; the imageMso for file&amp;gt;open and what a screentip and supertip look like.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/02/14/grouplabelbits.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;Having a &amp;#39;large&amp;#39; button exposes another feature of the ribbon and that is re-sizing. It will endeavour, as above to show it using it&amp;#39;s full size, but if the overall size of the application window does not allow, it will first drop it&amp;#39;s label and then shrink it&amp;#39;s size down to small.&lt;/p&gt;
&lt;p&gt;At this stage of course, loading the file will fire the onLoad callback and as there is no code it will return an error that the relevant code is not available. We&amp;#39;ll take a look at the callback code once we have built our tab.&lt;/p&gt;
&lt;h3&gt;Buttons, Boxes and Separators.&lt;/h3&gt;
&lt;p&gt;One button in a group, as in the previous section is fine, but as soon as you add more buttons in a group, coupled with the &amp;#39;re-size&amp;#39; effect and we must use some &amp;#39;hidden&amp;#39; controls, to stop the controls from flowing in undesirable directions. We use Boxes to achieve that, together with separators. Below is the code to add a new group (&amp;quot;Group2&amp;quot;) and two &amp;#39;sets&amp;#39; of three buttons, in vertical boxes with a separator dividing the two &amp;#39;sets&amp;#39; of three. Whilst you cannot see the boxes, I have drawn them in the resulting tab image below the code, so you can visualise it in your own mind. You can of course see the &amp;#39;vertical&amp;#39; separator. (It is only a vertical separator as it sits between two vertically aligned boxes, even in the code as you can see!).&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onLoad&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;loadRibbon&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;myTab1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Nick&amp;#39;s Tab&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;insertAfterMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;TabAddIns&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Z&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;A&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 1&amp;quot;&lt;/span&gt;
                        &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;OpenFileButton&amp;quot;&lt;/span&gt; 
                        &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the screentip of button1&amp;quot;&lt;/span&gt; 
                        &lt;span style="color:#ff0000;"&gt;size&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;large&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;supertip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the supertip of button1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Boxes and Buttons&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;vertical&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button1B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button2B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button3B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;separator&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;separator1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;vertical&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonA&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button A&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonB&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonC&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button C&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/02/14/boxesandbuttons1.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;If we now do the same with two sets of buttons in horizontal boxes, you will hopefully see the difference, both in the code and the ribbon image. Remember, horizontal buttons do not have a corresponding horizontal separator, separators do not have a style attribute...maybe v.Next!&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onLoad&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;loadRibbon&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;myTab1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Nick&amp;#39;s Tab&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;insertAfterMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;TabAddIns&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Z&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;A&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 1&amp;quot;&lt;/span&gt;
                        &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;OpenFileButton&amp;quot;&lt;/span&gt; 
                        &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the screentip of button1&amp;quot;&lt;/span&gt; 
                        &lt;span style="color:#ff0000;"&gt;size&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;large&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;supertip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the supertip of button1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;VBoxes and Buttons&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;vertical&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button1B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button2B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button3B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;separator&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;separator1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;vertical&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonA&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button A&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonB&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonC&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button C&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;

                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;HBoxes and Buttons&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;horizontal&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button1C&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button H1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button2C&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button H2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;horizontal&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonHA&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button HA&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonHB&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button HB&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box5&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;horizontal&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonHZ&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button HZ&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonHX&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button HX&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;

            &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/02/14/horizontalbox.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;You may notice in the above code snippets that we are using the same callback on the button onAction attribute. This allows us to make a decision based on the button pressed, using the passed &amp;#39;parent buttons&amp;#39; id, like so. For a button callback there are three captured properties, id, context and tag. Any or all of these can be used, stored in variables, on worksheets, in range names, etc.&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;Sub&lt;/span&gt; OpenFileButton(control &lt;span style="color:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl)
    &lt;span style="color:#0000ff;"&gt;If&lt;/span&gt; control.ID = &lt;span style="color:#006080;"&gt;&amp;quot;button1&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;Then&lt;/span&gt;
        &lt;span style="color:#008000;"&gt;&amp;#39;do this&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;Else&lt;/span&gt;
        &lt;span style="color:#008000;"&gt;&amp;#39;do this&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;If&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;The Gallery and dialogLauncher Controls.&lt;/h3&gt;
&lt;p&gt;Lastly for this part, we will look at two new controls in this first iteration of the ribbon. The gallery, (this is like the styles dropdown image store) and the dialogLauncher, which is a container control, carrying a button, that looks like a little diagonal arrow in the bottom right hand corner of a group, allowing you to fire a dialog (built-in or custom) on it being pressed.&lt;/p&gt;
&lt;h4&gt;The Gallery&lt;/h4&gt;
&lt;p&gt;Currently you cannot customise built-in galleries, but you can build your own and load your image collateral through the Custom UI Editor. This part is simple, just open the editor, click on the image toolbar button, navigate to your image files and select OK. This will load them in the side of the UI editor so they an be selected and loaded into the file. A gallery is once again a container control, with &amp;#39;items&amp;#39; below it that actually hold the images and fire callbacks, etc. It can also contain buttons, but these must appear below any items and they are the menu options that sit below the gallery items, like &amp;#39;New Cell Style,,,&amp;#39; on the cell style gallery on the home tab.&lt;/p&gt;
&lt;p&gt;The added code is below, with the image of the resulting controls below that:&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onLoad&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;loadRibbon&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;myTab1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Nick&amp;#39;s Tab&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;insertAfterMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;TabAddIns&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Z&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;visible&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;keytip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;A&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 1&amp;quot;&lt;/span&gt;
                        &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;OpenFileButton&amp;quot;&lt;/span&gt; 
                        &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the screentip of button1&amp;quot;&lt;/span&gt; 
                        &lt;span style="color:#ff0000;"&gt;size&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;large&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;supertip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is the supertip of button1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    
                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;VBoxes and Buttons&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;vertical&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button1B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button2B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button3B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button 3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;separator&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;separator1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;vertical&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonA&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button A&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonB&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button B&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonC&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button C&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;

                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;HBoxes and Buttons&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;horizontal&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button1C&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button H1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;button2C&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button H2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FileOpen&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;horizontal&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonHA&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button HA&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonHB&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button HB&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;box5&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;boxStyle&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;horizontal&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonHZ&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button HZ&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;buttonHX&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Button HX&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ButtonPressedMsgBox&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt; 
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;box&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;

                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Gallery&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;gallery&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Gallery1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Pictures&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;HeaderFooterPictureInsert&amp;quot;&lt;/span&gt;
                        &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;What have we here?&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ClickImage&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;columns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;rows&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;3&amp;quot;&lt;/span&gt; 
                        &lt;span style="color:#ff0000;"&gt;itemWidth&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;150&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;showItemLabel&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;itemHeight&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;150&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;size&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;large&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture1&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture2&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture3&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture4&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic5&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic5&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 5&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture5&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic6&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic6&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 6&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture6&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#008000;"&gt;&amp;lt;!--Buttons at bittom of gallery menu--&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;galleryMenuButton1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Fetch pictures...&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;PictureInsertFromFile&amp;quot;&lt;/span&gt; 
                            &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FetchPictures&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;galleryMenuButton2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Become an MVP...&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;mvp&amp;quot;&lt;/span&gt; 
                            &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;BecomeMVP&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;gallery&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;

            &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tab&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/02/14/gallery.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;We can add a dialogLauncher to the group that contains this gallery control now. IT MUST BE THE LAST CONTROL IN THE GROUP! It must also of course have a button to create the action required. The additional code is below (just the gallery control part with it added) and the resultant control in the corner of the group (with the cursor next to it).&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Group3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Gallery&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;gallery&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Gallery1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Pictures&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;HeaderFooterPictureInsert&amp;quot;&lt;/span&gt; 
    &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;What have we here?&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ClickImage&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;columns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;rows&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;3&amp;quot;&lt;/span&gt; 
    &lt;span style="color:#ff0000;"&gt;itemWidth&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;150&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;showItemLabel&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;itemHeight&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;150&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;size&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;large&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture1&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture2&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 3&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture3&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 4&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture4&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic5&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic5&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 5&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture5&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic6&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;pic6&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Picture 6&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is picture6&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#008000;"&gt;&amp;lt;!--Buttons at bittom of gallery menu--&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;galleryMenuButton1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Fetch pictures...&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;PictureInsertFromFile&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;FetchPictures&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;galleryMenuButton2&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Become an MVP...&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;image&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;mvp&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;BecomeMVP&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;gallery&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color:#008000;"&gt;&amp;lt;!--This group has a dialogBoxLauncher and button control which adds--&amp;gt;&lt;/span&gt;
  &lt;span style="color:#008000;"&gt;&amp;lt;!--the little arrow on bottom right of group Make it last control element in group--&amp;gt;&lt;/span&gt;
  &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;dialogBoxLauncher&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;button&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;myLauncher&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Dialog Launcher&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;screentip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is a screentip&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;supertip&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;This is a supertip&amp;quot;&lt;/span&gt;
    &lt;span style="color:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;LaunchDialog&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#008000;"&gt;&amp;lt;!--The dialogBoxLauncher is a container control--&amp;gt;&lt;/span&gt;
    &lt;span style="color:#008000;"&gt;&amp;lt;!--It needs a button control to add an onAction attribute--&amp;gt;&lt;/span&gt;
  &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;dialogBoxLauncher&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;group&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/02/14/dialoglauncher.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s going to be all for this part, in the final part we will explore the remaining popular controls, take a little more look at the callback signatures and attempt to invalidate the ribbon and change controls on the fly. Hopefully you&amp;#39;re enjoying it...stay tuned! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=968" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/RibbonX/default.aspx">RibbonX</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Excel+2007/default.aspx">Excel 2007</category></item><item><title>Ribbon, Step-by-Step. Part 3 (The Office Menu and Re-purposing)</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/02/03/ribbon-step-by-step-part-3-the-office-menu-and-re-purposing.aspx</link><pubDate>Sun, 03 Feb 2008 22:54:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:779</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>14</slash:comments><description>&lt;p&gt;In our first two parts we covered the file structure of Excel 2007 and some very simple customisations which, in the main, do not require any VBA code. in this part we are going to try and accomplish two things.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Customisation of the Office Menu (under the office button)&lt;/li&gt;
&lt;li&gt;Re-purposing built-in controls to do other things.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;In the next one or two parts we will cover more details on the various controls, including Galleries and Contextual tabs and then how we can capture the ribbon object and change controls &amp;#39;on the fly&amp;#39;, so... on with Part 3&lt;/p&gt;
&lt;h4&gt;Customising the Office Menu&lt;/h4&gt;
&lt;p&gt;As we have already discovered, the access point to this menu, the Office Button, cannot currently be modified (&lt;a href="http://excelusergroup.org/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=22&amp;amp;postid=752" target="_blank"&gt;although as we saw in Part 2, it can be removed&lt;/a&gt;), beneath this button is the Office Menu, which is analogous with the &amp;#39;File&amp;#39; menu in previous versions.&lt;/p&gt;
&lt;p&gt;In it&amp;#39;s standard form, it looks as below. The controls with a simple image, such as &amp;#39;New&amp;#39;, are &amp;#39;button&amp;#39; controls. Those with an arrow at the side are defined as &amp;#39;splitButton&amp;#39;, with &amp;#39;menu&amp;#39; and &amp;#39;button&amp;#39; controls on the fly-out menu presented from the &amp;#39;splitButton&amp;#39; deployment.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/OfficeMenu.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;As with all customUI code, the RibbonX starts with &amp;lt;customUI&amp;gt;&amp;lt;/customUI&amp;gt; tags and beneath that &amp;lt;ribbon&amp;gt;&amp;lt;/ribbon&amp;gt; tags. The &amp;lt;officeMenu&amp;gt;&amp;lt;/officeMenu&amp;gt; tags sit just below this and before any &amp;lt;tab&amp;gt;&amp;lt;/tab&amp;gt; members, like so: (notice we have left startFromScratch attribute off, so the code presumes &amp;quot;false&amp;quot;, e.g. keep the existing ribbon):&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;officeMenu&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;officeMenu&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The controls we require on the Office Menu, will sit between the &amp;lt;officeMenu&amp;gt;&amp;lt;/officeMenu&amp;gt; tags. in this example we will add one simple button, one split button with a &amp;#39;sub menu&amp;#39; beneath, with button and checkbox and disable one of the built-in buttons.&lt;/p&gt;
&lt;p&gt;To add a button we simply specify a new &amp;#39;button&amp;#39; control and set a unique id, like so: (The label attribute sets the actual text that appears on the &amp;#39;menu&amp;#39; item).&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;officeMenu&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;button&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;OfficeButton0&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;insertBeforeMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;FileSave&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;HappyFace&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;New Button&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;MBox&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;officeMenu&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;You may be wondering where you get all the existing control names, such as the &amp;quot;FileSave&amp;quot; above. It is actually pretty simple. If you go to Office Button&amp;gt;Excel Options&amp;gt;Customize, you can navigate to the command you want and hover over it and the tooltip that appears in braces (FileSave), is exactly (including case) how the control should be addressed as a parameter to the attribute.. below is the tooltip. You can use the same name for any imageMso, to get the built-in icon too.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/02/03/getribbonid.png" alt="" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now as we grow in confidence, we will add the two &amp;#39;splitButtons&amp;#39;, with their related &amp;#39;menu&amp;#39; and button&amp;#39; controls below. both these buttons are custom ones, declared with just an id (as apposed to a built-in one that would be declared idMso). Here is the code complete:&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;officeMenu&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;button&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;OfficeButton0&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;insertBeforeMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;FileSave&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;FileSave&amp;quot;&lt;/span&gt; 
            &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;New Button&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;MBox&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;splitButton&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;idMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;FilePrintMenu&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;menu&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
          &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;button&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;OfficeButton1&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;insertBeforeMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;FilePrintPreview&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;imageMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;HappyFace&amp;quot;&lt;/span&gt;
            &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Happy Print&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;description&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Prints a random joke in the footer of each document&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;MBox&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;checkBox&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;idMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;ViewGridlinesToggleExcel&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;menu&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;splitButton&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;button&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;idMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;FileClose&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;enabled&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;officeMenu&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So, reading the code top down we have&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A button (OfficeButton0), inserted before the &amp;#39;Save&amp;#39; button with the &amp;#39;Save&amp;#39; icon.&lt;/li&gt;
&lt;li&gt;A sub menu on the splitButton &amp;#39;Print&amp;#39; menu, with a button (OfficeButton1), inserted before the print preview button, with a Happy Face built-in icon.&lt;/li&gt;
&lt;li&gt;The same &amp;#39;sub-menu&amp;#39; also has a checkbox, which is the built-in one to display Excel Grid Lines. (see the idMso means a built-in control)&lt;/li&gt;
&lt;li&gt;The &amp;#39;Close&amp;#39; button (&amp;quot;FileClose&amp;quot;) at the base of the Office menu is disabled.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The image below show the &amp;#39;New Button&amp;#39;, the disabled &amp;#39;Close&amp;#39; button, the HappyFace button and checkbox on the &amp;#39;sub menu&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/02/03/officemenucustomised.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;You will have noticed the first use of &amp;#39;Callbacks&amp;#39; in the parameters above, e.g. &amp;#39;onAction&amp;#39;. There are many of these, but let&amp;#39;s settle on the main one at the minute which is onAction. This defines the name of the VBA code that should run when the control (button, etc) is pressed, clicked or whatever the default &amp;#39;action&amp;#39; is.&lt;/p&gt;
&lt;p&gt;Working with &amp;#39;callbacks&amp;#39; could not be simpler, when using the Office 2007 Custom UI editor. You simply press the &amp;#39;callback&amp;#39; toolbar button and it will create a new tab with all the code for all the &amp;#39;action&amp;#39; callbacks found in the RibbonX code. Now you can simply copy this from the callback pane and paste it into either standard or class modules in your workbook and write code between the stubs to connect actions to the controls.. (when pressing the callbacks button in our example I got the following code stub).&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for OfficeButton0 onAction&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; MBox(control &lt;span style="COLOR:#0000ff;"&gt;as&lt;/span&gt; IRibbonControl)
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Why only one stub when there are two &amp;#39;onAction&amp;#39; parameters? It&amp;#39;s because all the &amp;#39;onAction&amp;#39; parameters are asking for the same VBA code (MBox), so we can use just one code stub. This gives us an IRibbonControl object as a variable called &amp;#39;control&amp;#39;, which we can use to interrogate which control fired the MBox code, using the id property, thus:&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for OfficeButton0 onAction&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; MBox(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl)
&lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt; control.ID = &lt;span style="COLOR:#006080;"&gt;&amp;quot;OfficeButton1&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;Then&lt;/span&gt;
    MsgBox &lt;span style="COLOR:#006080;"&gt;&amp;quot;Why did the chicken cross the road?&amp;quot;&lt;/span&gt;, vbQuestion + vbOKOnly, control.ID
&lt;span style="COLOR:#0000ff;"&gt;Else&lt;/span&gt;
    MsgBox &lt;span style="COLOR:#006080;"&gt;&amp;quot;Nicole Smith is Dead!&amp;quot;&lt;/span&gt;, vbExclamation + vbOKOnly, control.ID
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;If&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This would give us the relevant message box depending on the id of the &amp;#39;pressed&amp;#39; button.&lt;/p&gt;
&lt;h3&gt;Re-Purposing Existing Controls.&lt;/h3&gt;
&lt;p&gt;As you will hopefully be starting to realise, many things you want to do with the Ribbon are starting to work out fairly simply and re-purposing existing commands is no different. You will see a clue in the text just gone. The member we will be dealing with here is the &amp;#39;command&amp;#39;, which, because Excel obviously has many &amp;#39;commands&amp;#39; the &amp;#39;command&amp;#39; member &amp;#39;nests&amp;#39; within the &amp;#39;commands&amp;#39; collection member. (Like a &amp;#39;tab&amp;#39; is contained within the &amp;#39;tabs&amp;#39; collection).&lt;/p&gt;
&lt;p&gt;You identify the commands in exactly the same way as we did above, by looking for it&amp;#39;s idMso in the customize dialog&amp;#39;s list. Once you have this idMso, there is little left to learn. The code below disables the &amp;#39;Italic&amp;#39; functionality on the ribbon, by setting it&amp;#39;s &amp;#39;enabled&amp;#39; attribute to &amp;quot;false&amp;quot; and then re-purposes the &amp;#39;Save&amp;#39; (FileSave) menu with a custom &amp;#39;OnAction&amp;#39; attribute. This will override the built-in save functionality in Excel. Below that is a screen shot of the disabled Italics button and the dialog &amp;#39;fired&amp;#39; when pressing &amp;#39;Save&amp;#39;.&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;commands&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;command&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;idMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Italic&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;enabled&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;command&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;idMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;FileSave&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;onAction&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;MySave&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;commands&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/02/03/repurpose.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;I hope, now we have covered RibbonX a few times, that little explanation is needed for this procedure, but for completeness, below is the VBA code &amp;#39;callback&amp;#39; generated by the CustomUI tool and placed in a standard module in the workbook.&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#008000;"&gt;&amp;#39;Callback for Save onAction&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; MySave(control &lt;span style="COLOR:#0000ff;"&gt;As&lt;/span&gt; IRibbonControl, &lt;span style="COLOR:#0000ff;"&gt;ByRef&lt;/span&gt; cancelDefault)
    MsgBox &lt;span style="COLOR:#006080;"&gt;&amp;quot;Sorry, like me, it can&amp;#39;t be saved&amp;quot;&lt;/span&gt;, vbExclamation + vbOKOnly, &lt;span style="COLOR:#006080;"&gt;&amp;quot;Bog Off&amp;quot;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, you will get an IRibbonControl object to identify the firing control and a parameter enabling you to enable or disable the default action (default is cancel=true). This enables you to only re-purpose on the pressing of a certain custom control, for example.&lt;/p&gt;
&lt;p&gt;This will be enough for this part. next time we will extend our knowledge of other controls and then in the final part we will move on to changing control state on the fly by capturing the Ribbon object and invalidating it.&lt;/p&gt;
&lt;p&gt;Stay tuned for the final one or two episodes! ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=779" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/RibbonX/default.aspx">RibbonX</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Excel+2007/default.aspx">Excel 2007</category></item><item><title>Ribbon, Step-by-Step. Part 2 (Begin Customisation)</title><link>http://excelusergroup.org/blogs/nickhodge/archive/2008/01/31/ribbon-step-by-step-part-2-begin-customisation.aspx</link><pubDate>Thu, 31 Jan 2008 23:46:00 GMT</pubDate><guid isPermaLink="false">afdc21cc-1618-45b1-a950-e47bb94e6e94:752</guid><dc:creator>Nick Hodge</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;In the &lt;a class="" href="http://excelusergroup.org/blogs/nickhodge/archive/2008/01/30/ribbon-step-by-step-part-1-file-formats.aspx" target="_blank"&gt;last part of this series&lt;/a&gt;, we went through the different file formats as a precursor to starting Ribbon customisation. You should by now have &lt;a class="" href="http://openxmldeveloper.org/articles/CustomUIeditor.aspx" target="_blank"&gt;downloaded the Office 2007 Custom UI Editor&lt;/a&gt;, as this is the tool we will be using to customise our RibbonX and generate callbacks for VBA. We&amp;#39;ll start with a run down of the tool itself. Remember, you need to have the .Net 2.0 framework, or above loaded on your development machine.&lt;/p&gt;
&lt;h3&gt;The Office 2007 Custom UI Editor&lt;/h3&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/customUIEditor.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;Without worrying too much about the code currently in the RibbonX pane (It is much easier to read when made wider, but the confines of this blog needs it narrower and causes the code to wrap), let&amp;#39;s just familiarise ourselves with the various parts of the tool. This shouldn&amp;#39;t take long as the interface is basic and un-cluttered with just the very necessary of options. Of note is the image store, this is where the collateral for new controls, like the &amp;#39;gallery&amp;#39; are stored for placing in the correct place in the file. The toolbar is pretty self-explanatory, except maybe the &amp;#39;Validate&amp;#39; button, which goes off to the framework and validates your RibbonX code for valid members and attributes and that it is well &amp;#39;formed&amp;#39;.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/wellformedUI.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;Then there&amp;#39;s the &amp;#39;Generate Callback&amp;#39; button, which scans your code for &amp;#39;action&amp;#39; attributes, like getImage, and generates code stubs for them all. More on that later, but below is the &amp;#39;Callback&amp;#39; tab that is generated by pushing this button and the code &amp;#39;stubs&amp;#39;&amp;nbsp;that can just be cut and pasted.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/UIEditorCallback.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;Lastly, before we progress with our first code, I want to draw attention to the &amp;#39;Sample&amp;#39; menu option (see below). When you install the tool a few are there, but by navigating to the &amp;#39;Samples&amp;#39; folder in the installation directory, you can place XML files which will appear as sample in the list. (On my machine this is C:\Program Files\CustomUIEditor\Samples), a handy feature to store your frequently used RibbonX.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/samplemenu.png" alt="" /&gt; &lt;/p&gt;
&lt;h3&gt;Components of the Ribbon&lt;/h3&gt;
&lt;p&gt;Below is a (rather squat) version of the ribbon, demonstrating the components we will be working with.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/ribbonparts.png" alt="" /&gt; &lt;/p&gt;
&lt;h4&gt;Ribbon&lt;/h4&gt;
&lt;p&gt;Although not detailed on the above image the ribbon is the entire area, containing Tabs, Groups, controls, etc. When we come to our first coding, you will see that this member sits right at the top of the hierarchy.&lt;/p&gt;
&lt;h4&gt;Tab&lt;/h4&gt;
&lt;p&gt;The tab is the way of navigating between different &amp;#39;topics&amp;#39; on the ribbon, Home, Insert, Page Layout, etc.&lt;/p&gt;
&lt;h4&gt;Groups&lt;/h4&gt;
&lt;p&gt;Groups sit on tabs and contain other controls, allowing you to &amp;#39;group&amp;#39; like controls, as such, the &amp;#39;Group has no attributes, just children like buttons, boxes, etc.&lt;/p&gt;
&lt;h4&gt;Control(s)&lt;/h4&gt;
&lt;p&gt;Contained on Groups or Menus (Office Menu), common types are button, gallery, dropDown, splitButton, etc&lt;/p&gt;
&lt;h4&gt;Tab Set&lt;/h4&gt;
&lt;p&gt;This is a container that holds contextual tabs, This groups the contextual tabs that are shown when the focus (cursor) has a certain selection, such as in this instance, when a pivot table is selected. This is without doubt a step forward in the ribbon, hiding the features only until the user needs it. (Excel 2003 has about 39 toolbars most of which users never see)&lt;/p&gt;
&lt;h4&gt;Office Menu (see below)&lt;/h4&gt;
&lt;p&gt;This is similar in functionality to the old &amp;#39;File&amp;#39; menu and contains, New, Save, Save as..., Print, Excel&amp;nbsp;Options (the old Tools&amp;gt;Options... menu choice)&amp;nbsp;and the Most Recently Used (MRU) list, (excuse mine!)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://excelusergroup.org/blogs/nickhodge/08/01/31/OfficeMenu.png"&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/OfficeMenu.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Dialog Launcher&lt;/h4&gt;
&lt;p&gt;This little button, which is actually just a container and needs a button child to action it, will fire the &amp;#39;old style&amp;#39; dialog or your custom UserForms, MsgBoxs, etc., so if we look at the dialog launcher highlighted in the Ribbon image&amp;nbsp;above, it will launch the dialog currently accessed through Format&amp;gt;Cells, focused on the &amp;#39;font&amp;#39; tab.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/fonttab.png" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;Lastly, the interesting part is while Microsoft dumped &amp;#39;CommandBars&amp;#39; for the Ribbon, the old StatusBar, which has now got much more functionality, is now...a CommandBar! (CommandBars(&amp;quot;Status Bar&amp;quot;)).&lt;/p&gt;
&lt;h3&gt;Our First Customisation&lt;/h3&gt;
&lt;h4&gt;startFromScratch&lt;/h4&gt;
&lt;p&gt;The most basic thing you can do is to remove the standard ribbon, almost entirely. This will not be necessary in all code situations as you will be sometimes just adding to existing tabs, etc. You should know however that startFromScratch=&amp;quot;true&amp;quot; is necessary if you want to author anything to do with the QAT. (Personally, I think the QAT should be left alone as it is very personal to the user).&lt;/p&gt;
&lt;p&gt;For this first example we will do this in numbered steps so you can hopefully follow along.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt; All RibbonX members, etc are typed in camel-case. this says that they have no spaces, start with a lower-case letter and then have the first letter of each new word capitalised, so onAction, startFromScratch, insertAfterMso, etc. There are some names which defy this logic &amp;lt;group idMso=&amp;quot;GroupFont&amp;quot;&amp;gt; (note the GroupFont capitalises both words), so you must be careful, but certainly try camelCase first.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; A big advantage of what we are about to do is that all the code to customise is contained in the workbook, close the workbook or unload the add-in and all your Ribbon will return exactly as was, you cannot damage anything, unlike sloppy coders who often left CommandBar litter after their code exited.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Throughout all of this Ribbon development, particularly when we get on to files containing VBA code, I would set up a folder somewhere on your local machine and set it as a &amp;#39;trusted location&amp;#39; under, Office Button&amp;gt;Excel Options&amp;gt;Trust Center&amp;gt;Trust Center Settings... This will prevent you having to enable macros each time you test your code. (Obviously, (apart from the &amp;#39;Full&amp;#39; dictator app below, that has VBA code), you will not need that for any workbooks in this second part, as these are code-less demonstrations)&lt;/p&gt;
&lt;p&gt;So...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a new Excel File and save it as test.xlsx.&lt;/li&gt;
&lt;li&gt;Close this file (this step is a little annoying each time you want to test, but essential so that the Custom UI Editor can open it, without a share violation)&lt;/li&gt;
&lt;li&gt;Open the Custom UI Editor&lt;/li&gt;
&lt;li&gt;In the editor, press the open button and navigate to your new file. You should at this stage see nothing.&lt;/li&gt;
&lt;li&gt;In the RibbonX pane, type the namespace identifier (this tells the code where in the framework to look for the &amp;#39;hooks&amp;#39; and starts every piece of RibbonX) and a ribbon member, followed by the startFromScratch attribute, as below.&lt;/li&gt;
&lt;li&gt;Press the &amp;#39;Validate&amp;#39; button to check compliance&lt;/li&gt;
&lt;li&gt;Press Save and Close&lt;/li&gt;
&lt;li&gt;Now open your workbook!&lt;/li&gt;&lt;/ol&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If everything went to plan, you should have virtually no Ribbon left, not quite a dictator application, but equally not bad from one line of code. If you look carefully, you will find the Office Menu has shrunk to a few very basic features and that&amp;#39;s about it. Compare the picture below with the one above.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://excelusergroup.org/blogs/nickhodge/08/01/31/startFromScratchOffMenu.png"&gt;&lt;img src="http://excelusergroup.org/blogs/nickhodge/08/01/31/startFromScratchOffMenu.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you still have Ribbon, then you have not got the RibbonX quite right and it is not very forgiving in this way. Generally it will be a case issue (camelCase), but it does not throw a syntax error, just doesn&amp;#39;t display or change the Ribbon, so always check that if the unexpected happens.&lt;/p&gt;
&lt;p&gt;As we move on, we will add other elements, etc between the start &amp;lt;ribbon&amp;gt; and end &amp;lt;/ribbon&amp;gt; tags, which makes sense as everything is &amp;#39;contained&amp;#39; in/by the ribbon.&lt;/p&gt;
&lt;h4&gt;Full &amp;#39;Dictator&amp;#39; Application&lt;/h4&gt;
&lt;p&gt;Many of you will not call the code above a dictator application as there are still some elements of the Excel UI that can be &amp;#39;played&amp;#39; with by users. I am grateful to Jim Rech for the lead in discovering how to do this and big surprise, the only way to do it is to return to pre-VBA days of Excel4 macros, which is totally amazing! If you paste the code below into a new workbook and run it, you will see an Excel 2007 full dictator application with VBA (running XL4 macros)&lt;/p&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;Sub&lt;/span&gt; RemoveAll()
&lt;span style="COLOR:#008000;"&gt;&amp;#39;ExecuteExcel4Macro portion by Jim Rech&lt;/span&gt;
&lt;span style="COLOR:#008000;"&gt;&amp;#39;Other code Nick hodge&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt; Application
        .ExecuteExcel4Macro &lt;span style="COLOR:#006080;"&gt;&amp;quot;SHOW.TOOLBAR(&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#006080;"&gt;&amp;quot;Ribbon&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#006080;"&gt;&amp;quot;,False)&amp;quot;&lt;/span&gt;
        .CommandBars(&lt;span style="COLOR:#006080;"&gt;&amp;quot;Status Bar&amp;quot;&lt;/span&gt;).Visible = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
        .DisplayFormulaBar = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
        .DisplayScrollBars = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
        .Caption = &lt;span style="COLOR:#006080;"&gt;&amp;quot;It&amp;#39;s all gone!&amp;quot;&lt;/span&gt;
        .ActiveWindow.DisplayHeadings = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
        .ActiveWindow.DisplayWorkbookTabs = &lt;span style="COLOR:#0000ff;"&gt;False&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; &lt;span style="COLOR:#0000ff;"&gt;With&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Lastly for today, we will go back to RibbonX and remove the existing Ribbon, create a custom tab, with a built in group, that just works, no code and saved as an xlsx&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a new file and save off somewhere as an xlsx and close&lt;/li&gt;
&lt;li&gt;Open the file in the Custom UI Editor&lt;/li&gt;
&lt;li&gt;Enter the code below into the RibbonX pane&lt;/li&gt;
&lt;li&gt;Validate the code&lt;/li&gt;
&lt;li&gt;Close the file and the Custom UI Editor&lt;/li&gt;
&lt;li&gt;Open the workbook and it should now have one tab, called favourites and a group (GroupFont) that if you try the controls on it, will just work.&lt;/li&gt;&lt;/ol&gt;
&lt;div style="BORDER-RIGHT:gray 1px solid;PADDING-RIGHT:4px;BORDER-TOP:gray 1px solid;PADDING-LEFT:4px;FONT-SIZE:8pt;PADDING-BOTTOM:4px;MARGIN:20px 0px 10px;OVERFLOW:auto;BORDER-LEFT:gray 1px solid;WIDTH:97.5%;CURSOR:text;MAX-HEIGHT:200px;LINE-HEIGHT:12pt;PADDING-TOP:4px;BORDER-BOTTOM:gray 1px solid;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BACKGROUND-COLOR:#f4f4f4;"&gt;&lt;pre style="PADDING-RIGHT:0px;PADDING-LEFT:0px;FONT-SIZE:8pt;PADDING-BOTTOM:0px;MARGIN:0em;OVERFLOW:visible;WIDTH:100%;COLOR:black;BORDER-TOP-STYLE:none;LINE-HEIGHT:12pt;PADDING-TOP:0px;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;BORDER-RIGHT-STYLE:none;BORDER-LEFT-STYLE:none;BACKGROUND-COLOR:#f4f4f4;BORDER-BOTTOM-STYLE:none;"&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/office/2006/01/customui&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;startFromScratch&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tab&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;myTab&amp;quot;&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;label&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;Favourites&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;group&lt;/span&gt; &lt;span style="COLOR:#ff0000;"&gt;idMso&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;=&amp;quot;GroupFont&amp;quot;&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;group&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tab&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;tabs&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;ribbon&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#800000;"&gt;customUI&lt;/span&gt;&lt;span style="COLOR:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Hopefully this is still fairly simple, note that you have a ,&amp;lt;tabs&amp;gt;&amp;lt;/tabs&amp;gt; tag as a ribbon can have multiple tabs and then below that is a &amp;lt;tab&amp;gt;&amp;lt;/tab&amp;gt; tag. This sets our single tab (remember we removed the existing with the startFromScratch attribute), between these tags, as they are &amp;#39;contained&amp;#39; on the tab, we use the &amp;lt;group&amp;gt;&amp;lt;/group&amp;gt; tags to bring in Microsoft&amp;#39;s &amp;#39;Font&amp;#39; group with all it&amp;#39;s standard controls, that just work!&lt;/p&gt;
&lt;p&gt;The only attribute a member needs is either an id as in the tab that uniquely identifies it, or an idMso, as in the group, which identifies a built-in tab, group, control, etc. basically, if Microsoft made it, it&amp;#39;s idMso, if you do, it&amp;#39;s just id.&lt;/p&gt;
&lt;p&gt;So that&amp;#39;s enough for today, but you just removed the existing ribbon, replaced it with a custom tab, called favourites, placed on it a working &amp;#39;copy&amp;#39; of the font group, all with 10 lines of code. (and that&amp;#39;s generous as I have to have opening and closing tags, so it&amp;#39;s really five!)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;More to come... Stay tuned for part 3!&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://excelusergroup.org/aggbug.aspx?PostID=752" width="1" height="1"&gt;</description><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/RibbonX/default.aspx">RibbonX</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://excelusergroup.org/blogs/nickhodge/archive/tags/Excel+2007/default.aspx">Excel 2007</category></item></channel></rss>