Excel 2007 Ribbon: Button Alignment

Posted on 2011-10-22
Last Modified: 2012-05-12
Hi Guys,

I have a client who uses an a custom designed xml ribbon within Excel 2007.

They have requested one of the custom buttons be aligned to the far right of the ribbon. Having scouring the web, it looks as though everything is defaulted to the left and is difficult to pull off.

Is it possible to have this functionality, or have to settle with M$ ribbon restrictions?

Hope you can assist :)

Possible Solution

Here is my current xml code:

<customUI xmlns="">
<ribbon startFromScratch="false">
<tab id="Tab5" label="Timesheet">
<group id="Group5" label="Macro Buttons">
<button id="Custom_Btn_Macro4" label="Chargeable" size="large" onAction="CallControl" imageMso="FunctionsStatisticalInsertGallery" />
<button id="Custom_Btn_Macro11" label="Service Charge" size="large" onAction="CallControl" imageMso="InternationalCurrency" />
<button id="Custom_Btn_Macro10" label="Stop" size="large" onAction="CallControl" imageMso="CancelRequest" />
<button id="Custom_Btn_Macro12" label="Archive" size="large" onAction="CallControl" imageMso="LoadFromQuery" />
Question by:icuadmin
    LVL 11

    Expert Comment

    by:Swapnil Nirmal
    LVL 1

    Author Comment

    Guys I figured it out, thanks for the response.
    LVL 1

    Author Comment

    I've requested that this question be deleted for the following reason:

    Figured the problem out myself
    LVL 85

    Expert Comment

    by:Rory Archibald
    It would be nice if you posted the answer and then accepted your own answer, rather than just deleting the question.
    LVL 1

    Accepted Solution

    Ok, I figured if you insert a blank button exluding any label xml code, if you create enough of them then it will align to the far right of the screen. This was through trial and error and studying the code hard enough.

    Notice the space between the " ", this is very important.

    <button id="Custom_Btn_Macro4" label="" size=" " onAction=" " imageMso=" " />

    LVL 1

    Author Comment

    I wish revoke to deleting the question by mistake. I have posted the answer to help others also.

    LVL 1

    Author Closing Comment

    Fixed this myself, thanks for your help anyway guys.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
    This article will show you how to use shortcut menus in the Access run-time environment.
    This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
    This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now