Results 1 to 2 of 2

Thread: PowerPoint VBA to get value from Ribbon Control

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,877
    Location
    Maybe you can integrate something like this

    Option Explicit
    Dim ddIndex As Long
    Dim ddDept As String
    ' Callback for DdropDown onAction
    
    Sub DReportSelection(control As IRibbonControl, id As String, index As Integer)
        ddIndex = index
    End Sub
    
    'Callback for Button onAction
    Sub ExcelImport(control As IRibbonControl)
        Macro4Department (ddIndex)
    End Sub
    
    Sub Macro4Department(i As Long)
        Select Case i
            Case 0
                MsgBox "Department 1 is selected ", vbInformation
            Case 1
                MsgBox "Department 2 is selected ", vbInformation
            Case 2
                MsgBox "Department 3 is selected ", vbInformation
        End Select
    End Sub

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"><ribbon>
     <tabs>
    <tab id="CustomTab" label="TestLabel">
        <group id="SampleGroup" label="BU Selection">   
            <dropDown id="DdropDown" label="Select Dept" onAction="DReportSelection">
                <item id="item1" label="Depart 1" />
                <item id="item2" label="Depart 2" />
                <item id="item3" label="Depart 3" />
            </dropDown>
         </group >
    
    
        <group id="SampleGroup1" label="TestLabel">
               <button id="Button" label="Import Excel" imageMso="MicrosoftExcel" screentip="Import Data from Excel" size="large" onAction="ExcelImport" />
         </group >
    </tab>
     </tabs>
    </ribbon>
    </customUI>
    Attached Files Attached Files
    Last edited by Aussiebear; 03-09-2025 at 08:49 PM.
    ---------------------------------------------------------------------------------------------------------------------

    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

Tags for this Thread

Posting Permissions

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