+ Reply to Thread
Results 1 to 6 of 6

refreshRibbon?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Question refreshRibbon?

    Hi,

    I am investigating how to customize ribbon in xl2007-xl2010 and I see controls can be defined with some procedures suchas getItemLabel, getItemCount etc for dropdown menus

    what I am curious is if it is possible to force "refresh" on the ribbon. If this dropdown is based on cells content, can I force the contents of the dropdown to refresh to reflect changes on the sheet?
    this is certainly possible in xl2003 by deleting and recreating the toolbar

    what I do not know is how to achieve the same with xl2007

    any ideas?

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: refreshRibbon?

    You must store reference to Ribbon in onLoad event and you may then use this IRibbonUI object to invalidate whole ribbon or individual controls.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Re: refreshRibbon?

    Thank you Izandol,

    but i do not really understand
    where do I need to put the code?
    do you have example code "refresh" ribbon such as when workbook loads?

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: refreshRibbon?

    Workbook ribbon will always refresh when it is loaded. You must put onLoad callback into CustomUI part - so it will start:
    PHP Code: 
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <customUI onLoad="RibbonOnLoad
    In workbook you will have:
    Dim rib As IRibbonUI
    
    Sub RibbonOnload(ribbon As IRibbonUI)
       Set rib = ribbon
    End Sub
    then you may call rib.Invalidate from other routines.

  5. #5
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Re: refreshRibbon?

    Ok, now I understand a little more, but not yet all.
    for instance, if I want the content of a drop down menu to refresh when I change sheets -- how should I do it?
    I guess that the rib variable will not stay there for ever, will it?

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: refreshRibbon?

    It will remain unless there is state loss. This is good information: http://www.rondebruin.nl/win/s2/win015.htm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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