Consulting

Results 1 to 9 of 9

Thread: What kind of dimension is a ribbon?

  1. #1
    VBAX Contributor
    Joined
    Apr 2015
    Location
    Germany
    Posts
    167
    Location

    What kind of dimension is a ribbon?

    Hi there,

    a few weeks ago Paul taught me how to make my tab the active one (thank you!), using:

    Sub OnRibbonLoad(ribbon As IRibbonUI)
        Set oRibbon = ribbon
        oRibbon.ActivateTab ("MyTab")
         
    End Sub
    This used to work fine, as long as I didn't use Option Explicit. Now debugging asks what kind of variable "oRibbon" is. Can anyone help me? Thanks in advance!

    RG

    btw: I use 2010.
    Last edited by RandomGerman; 08-13-2015 at 07:56 AM. Reason: Added Information

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Dim oRibbon As IRibbonUI
    Capture.JPG
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Contributor
    Joined
    Apr 2015
    Location
    Germany
    Posts
    167
    Location
    Thank you, Paul.

    The new code:

    Public myRibbon As IRibbonUI
     
    Sub OnRibbonLoad(ribbon As IRibbonUI)
        Dim oRibbon As IRibbonUI
       Set oRibbon = ribbon
       oRibbon.ActivateTab ("MyTab")
         
    End Sub
    This works perfect on my machine. I tried to install the same add-in on a different machine and there the ribbon appears and all other macros work well - but the ribbon is not in front, when opening PowerPoint. I remember, one reason could be the PowerPoint version, but as mine is 2010 and the other one is 2013 it shouldn't be the point. Or am I going wrong here? Are any other possible reasons known?

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Might be a scope issue -- try this


     
    Public oRibbon As IRibbonUI 
     
    Sub OnRibbonLoad(ribbon As IRibbonUI) 
        Set oRibbon = ribbon 
        oRibbon.ActivateTab ("MyTab") 
         
    End Sub
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    VBAX Contributor
    Joined
    Apr 2015
    Location
    Germany
    Posts
    167
    Location
    Same result. Works on the 2010 machine, doesn't work on the other one. But I found out a new detail: The problem only appears with the ppam. For the pptm it works. Is anything known about this? Maybe a saving issue? Or security settings?

  6. #6
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Make sure that the Add-ins folder is a trusted location

    I don't have 2013 on any of the computers
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #7
    VBAX Contributor
    Joined
    Apr 2015
    Location
    Germany
    Posts
    167
    Location
    It is a trusted location. That wasn't the point. Thank you for trying, Paul. Maybe I should repost the problem in the PowerPoint group as there is more traffic. Maybe someone there has already heard of the problem.

  8. #8
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    The following worked for me ppt 2013

    Public gRibbonUI As IRibbonUI
    
    Sub rbx_onLoad(ribbon As IRibbonUI)
        Set gRibbonUI = ribbon
        gRibbonUI.ActivateTab "Tab1"
    End Sub
    Saved as a pptm the tab was activated when file was opened.
    Saved as a ppam the tab was activated when addin was loaded via the addin dialog. In fact you can use the checkbox in the dialog to see the tab disappear and appear with focus.

    I would assume the problem is the focus is being moved by the opening of a presentation file.
    Cheers
    Andy

  9. #9
    VBAX Contributor
    Joined
    Apr 2015
    Location
    Germany
    Posts
    167
    Location
    Hi Andy,

    thank you for your thoughts.

    The way I load up the ppam is:
    Save it to C:/Users/MyName/AppData/Roaming/Microsoft/Addins
    Open PowerPoint, go to File, go to Options, go to Addins
    Go to Manage at the bottom of the window, choose PowerPoint Addins, then click Go
    And in the new window click on "Add new" and select the ppam.

    The tab appears, every macro works - except the one to make the tab the active one, while even this macro works when I open the pptm on the same machine.

    Do you see any mistake in my way to proceed?

    Thank you!
    RG

Posting Permissions

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