+ Reply to Thread
Results 1 to 8 of 8

Customised ribbon - displaying a group based on pressing a button in another group

  1. #1
    Registered User
    Join Date
    01-21-2006
    Posts
    45

    Customised ribbon - displaying a group based on pressing a button in another group

    Hi

    How can I display the buttons in one group (ID = "DTGroup") on a Tab in my customised ribbon as a result of clicking a button within another group (ID = "Setup") of buttons under the same Tab.

    I have hidden the DTGroup on opening the workbook (by entering the attribute "visible = false" in my XML code). I want to now show the DTGroup when the user clicks a button in the Setup group.

    It used to work with CommnadBars using the "Enabled" and "Visible" properties which could be set within a procedure called by another CommandBar control.

    Any help appreciated.

    Mick
    Last edited by micklloyd; 01-15-2012 at 06:22 AM.

  2. #2
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Customised ribbon - displaying a group based on pressing a button in another grou

    You would need a getVisible callback. See Ron de Bruin's MSDN article here as an example.
    Good luck.

  3. #3
    Registered User
    Join Date
    01-21-2006
    Posts
    45

    Re: Customised ribbon - displaying a group based on pressing a button in another grou

    Hi - thanks for responding on this one too.

    I have tried the Ron de Bruin fix but am having problems with it. I downloaded the file from his site and used the first part of it verbatim as he suggested. However when I have the following in my code, I get an "Invalid outside procedure" error from using Set.
    <code>
    'Callback for customUI.onLoad
    Private Declare Sub RibbonOnLoad Lib "CByte" Alias "#116" ()
    Set Rib = ribbon
    End Sub
    </code>

    I actually tried to compile Ron's own file to see if it would work and it crashed Excel every time. It also crashed when I clicked on Enable Content after the file loaded.

    Mick

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Customised ribbon - displaying a group based on pressing a button in another grou

    Which file did you use? That code looks very strange to me - you cannot add code or an end sub to a Declare Sub statement.
    Are you using 2007 or 2010? If the latter, is it 32bit or 64bit Office?

  5. #5
    Registered User
    Join Date
    01-21-2006
    Posts
    45

    Re: Customised ribbon - displaying a group based on pressing a button in another grou

    Hi -thanks again.

    The file is from the getVisible.zip file downloaded from Ron's site. I can't remember exactly which one and can't now open any of the files therein to check the VBA code. Each time I click on Enable Content, Excel crashes (Error 400). I'm using Excel 2010.

    Anyway, since I've learned more about the XML code attached to my file I've managed to combine other buttons in a menu so saved space on the ribbon. I've decided to have the previously hidden menu available permanently. Nonetheless, thanks very much for your assistance.

    Mick

  6. #6
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Customised ribbon - displaying a group based on pressing a button in another grou

    As a matter of interest, is it Excel 2010 64bit or 32bit?

  7. #7
    Registered User
    Join Date
    01-21-2006
    Posts
    45

    Re: Customised ribbon - displaying a group based on pressing a button in another grou

    32bit I believe.

  8. #8
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Customised ribbon - displaying a group based on pressing a button in another grou

    Strange. I will have a look through the zip file later on and see if I can see anything strange about the workbooks. If so, it would be worth alerting the author.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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