Ribbon, you're nothing to me now. You're not a brother, you're not a friend. I don't want to know you or what you do. I don't want to see you at the hotels, I don't want you near my house. When you see our mother, I want to know a day in advance, so I won't be there. You understand?
Last week I said: "As a developer (not a user), my first impression of the Ribbon is a good one. I fully expect it to turn sour ..."
Consider it soured.
Whilst struggling with the Ribbon over the last week, I took stock of what is important in a menu. There are three basic things that I want to do with a toolbar/menu.
- Run code when a button is pressed
- Add/delete buttons from existing toolbars
- Disable buttons when they're out of context
The Ribbon runs code when I press buttons. Awesome. There's probably a way to add buttons to existing groups, but I can't figure it out. In my add-in, I have this xml code:
<customui xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="dkInvTab" label="Invoices">
<group id="dkInvGroup" label="Invoices">
<button id="dkInvNew"
label="Create New Invoice"
size="large"
onAction="CreateNewInvoice" />
<button id="dkInvOpen"
label="Open Existing Invoice"
size="large"
onAction="OpenInvoice" />
</group>
</tab>
</tabs>
</ribbon>
</customui>
It adds a tab, then a group, then two buttons that I always want active. I want to add two more buttons when my invoice template is active. That should be easy enough.
<customui xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="dkInvTab">
<group id="dkInvGroup">
<button id="dkinvSave"
label="Save Invoice"
size="large"
onAction="SaveInvoice" />
<button id="dkInvCalcTax"
label="Calculate Sales Tax"
size="large"
onAction="CalcTax" />
</group>
</tab>
</tabs>
</ribbon>
</customui>
Nope, that doesn't do it. I open my template and the Ribbon doesn't change. The xml is well formed, per the Custom UI Editor. There may be a syntax error in there that's causing the problem, but I don't see it. And Excel isn't going to tell me where it is.
But I really don't want to add those buttons when the invoice template is active. I want to add them as disabled when the add-in is loaded and enable them when the invoice template is active. I should be able to do that with xml that looks like this:
<customui xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="dkInvTab">
<group id="dkInvGroup">
<button id="dkinvSave" enabled="true" />
<button id="dkInvCalcTax" enabled="true" />
</group>
</tab>
</tabs>
</ribbon>
</customui>
Download music on line
Download mp3 music
mp3 online
buy music online
buy mp3 music
Download mp3 music online
Download free MP3 music
Download Adobe software
Download Adobe software
Download Adobe software
Download Adobe software
Music downloads
Online MP3 music
MP3 music downloads online
Downloads music mp3
mp3 downloads online
Buy phentermine
buy viagra online buy cialis online buy levitra online buy cialis professional online buy tramadol online
buy xanax no prescription
Nope, that doesn't do it. Apparently I have to use a getEnabled event to change the enabled status. As far as I can tell, that event only runs when the add-in is loaded. WTF good is that? How exactly is that an event? I'm really struggling to figure out what the people who designed this customization scheme were thinking.
Let's assume for a moment that there is a way to enable/disable buttons based on the active workbook. Do I have to use event procedures to somehow refresh the ribbon and check what's active? I already have to do that with the Commandbars object model, so what's the benefit to me, as a developer, to using the Ribbon? None, that I can see.
So I'm sticking with Commandbars for now. It adds them to the Add-ins tab, which I don't like. But it allows me to easily enable and disable buttons, which I do like.
I'm a reasonable guy. I'd like to think that the Ribbon is a work in process and that the next iteration will be better. But I've culled my list of requirements to three things and they didn't get those right. How can I expect them to produce something worthwhile when they can't even get the basics right. I'm soured. Even when someone shows me how to do what I want, I'll still be soured. It's not intuitive and it's hard to debug. I simply don't like it.