Excel Menu builder
Monday, 25th February, 2008Here is my (free) menu builder. Its for classic Excel only, but maybe one of you ribbon fanbois would modify it to work with 2007 too? Ribbon XML is so easy right?
I haven’t made much effort to tidy it up for release, its just as I use it (ie tested and working on my machine, last time I needed it, nothing more).
There are plenty of other menu builders around, but often they are worksheet driven. Thats great for .xls and .xla stuff, but as I do a lot of COM stuff its not ideal. My one uses a worksheet initially, but actually outputs a .bas module. That can then be imported to an excel based project or a VB6 one.
Watch out though as the code appends, so if you run it a few times with the same output file you end up with tons of repeated code. I am sure there was a reason why its like that, I can’t remember it though.
Here are the base settings:
And here is the table where you fill in the menu text, tooltips etc.
It only does basic buttons, you can just go in and adjust the VBA if you need any fancy stuff. It does a matching toolbar and menu. Just delete the code for the bits you dont want.
The workbook also has an embedded toolbar with the first 1,000 toolbar buttons on it, with their IDs. When you shut the workbook that stays around. You can hide it or delete it from Tools>>Customise>>Toolbars. I have never found these embedded toolbars very manageable, so I always create and destroy my menus on open and close. Doing that with 1,000 buttons is painfuly slow though.
The code is open and unprotected, but all the work is done concatenating strings in the worksheets (the hidden one called workings). It also has basic instructions.
Let us know what you think
cheers
Simon

