+ Reply to Thread
Results 1 to 11 of 11

Width of Dynamic Menu : Excel Ribbon

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Width of Dynamic Menu : Excel Ribbon

    I have a DynamicMenu as part of an custom Excel Ribbon.

    The problem I have is the the menu contains a list different length menu options.

    Upon selecting a menu item I change the menu text to be the selected item text.

    The ribbon then resizes the menu width to the width of the text.

    Is there some way to make a ribbon element a fixed a width?
    www.leansoftware.net

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Width of Dynamic Menu : Excel Ribbon

    Can you post example file to illustrate the problem you are trying to avoid
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Width of Dynamic Menu : Excel Ribbon

    Quote Originally Posted by Andy Pope View Post
    Can you post example file to illustrate the problem you are trying to avoid
    Hi Andy,
    sure I will post something up on Monday.
    Cheers
    Richard

  4. #4
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Width of Dynamic Menu : Excel Ribbon

    Andy,

    Please see attached example.
    LeanMenuDemo.xlsm

    When selecting a menu item the controls to the right will shift left/right depending on the length of the selected menu item.

    I would like to make the menu fixed width, or be able to specify a minimum and maximum width.

    Rihard

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Width of Dynamic Menu : Excel Ribbon

    You can not control the width of the menu text using a property.

    You can fix the width of the group by using a label control.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Width of Dynamic Menu : Excel Ribbon

    Andy,

    I see - that is useful.

    I have utilised as a label above the menu - to make use of the space ..
    LeanMenuDemo2.xlsm

    Thank you very much !

    Richard
    Last edited by richard.briggs; 06-02-2014 at 06:13 AM.

  7. #7
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Width of Dynamic Menu : Excel Ribbon

    Corrected download in above post

  8. #8
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Width of Dynamic Menu : Excel Ribbon

    Unfortunately, I have found with Excel 2013, the trailing spaces are ignored/removed by the ribbon.
    I tried using the tab character but that also is 'consumed'.

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Width of Dynamic Menu : Excel Ribbon

    try this variation in getSelectedLabel callback.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Width of Dynamic Menu : Excel Ribbon

    That is interesting - using a the non breaking space the text then flows over into the next ribbon group.

    I am starting to live with the resize behaviour of the ribbon, and have redesigned/rearranged things so the resize effect is not such a problem.

    Many thanks Andy

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Width of Dynamic Menu : Excel Ribbon

    I don't see the overflow but xl2013 does seem to strip empty characters.

    You can box the label and dummy buttons to pad out the group. The buttons can have no image, CHR(160) labels and not enabled.
    xl2013 still strips something from the buttons label so you need about 10 buttons. And you would need to return different length label text for xl2010 as that does honour the spaces.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Dynamic menu arrays (custom ribbon tab) only partly rebuilt after loss of state recovery
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-11-2013, 09:57 PM
  2. Setting up own menu on Excel ribbon
    By mahmudp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2012, 12:27 PM
  3. Edit the Excel Ribbon - custom menu??
    By GeneralDisarray in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2011, 10:15 AM
  4. Hide file menu ribbon excel 2010
    By DavidMorrison in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2010, 05:19 PM
  5. Excel 2007 Ribbon Menu
    By webbug08 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-01-2009, 03:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1