Consulting

Results 1 to 10 of 10

Thread: "The macro cannot be found" when clicking on the ribbon

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,862
    Location
    1. One of us is very confused

    2. Based on the zipped customizations file, it looks like you're adding a macro named updatePropertiesCallback to the QAT (not the Ribbon):

    <mso:cmd app="PowerPoint" dt="1" /><mso:customUI xmlns:macro="http://schemas.microsoft.com/office/2009/07/customui/macro" xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
     <mso:ribbon>
      <mso:qat>
       <mso:sharedControls>
        <mso:control idQ="mso:FileNewDefault" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:FileOpenUsingBackstage" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:FileSave" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:FileSendAsAttachment" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:FilePrintQuick" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:PrintPreviewAndPrint" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:Spelling" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:SlideShowFromBeginning" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:PointerModeOptions" visible="false" insertBeforeQ="mso:AutoSaveSwitch"/>
        <mso:control idQ="mso:AutoSaveSwitch" visible="false"/>
        <mso:control idQ="mso:Undo" visible="false"/>
        <mso:control idQ="mso:RedoOrRepeat" visible="false"/>
        <mso:control idQ="mso:FormatPainter" visible="true"/>
        <mso:control idQ="mso:FontColorPicker" visible="true"/>
        <mso:control idQ="mso:BulletsGallery" visible="true"/>
        <mso:control idQ="mso:LanguageCommands" visible="true"/>
        <mso:control idQ="mso:ReviewNewComment" visible="true"/>
        <mso:control idQ="mso:SymbolInsert" visible="true"/>
        <mso:control idQ="mso:AnimationAddGallery" visible="true"/>
        <mso:control idQ="mso:ViewSlideMasterView" visible="true"/>
        <mso:control idQ="mso:MasterViewClose" visible="true"/>
        <mso:button  id="updateProperties" visible="true" label="updateProperties" imageMso="RecurrenceEdit" onAction="updatePropertiesCallback"/>
       </mso:sharedControls>
      </mso:qat>
     </mso:ribbon>
    </mso:customUI>
    You can call it a callback, but it really isn't; it's just the name of the macro, and AFAIK doesn't take parameters



    3. So defining the macro's call like this is for ribbon controls (not customizations) and is the reason that the QAT button cannot find a macro in that PPTM

    Option Explicit
    
    Sub updatePropertiesCallback(control As IRibbonControl)
        MsgBox "test"
    End Sub

    4. Defined like this, the QAT icon does find the macro, and you could give it a more meaningful name like "updateProperties"

    Option Explicit
    
    Sub updatePropertiesCallback()
        MsgBox "test"
    End Sub
    Capture.JPG


    5.

    2. Can I use an absolute filename to a file containing macros I want to use in all presentations?
    Make it an add in (PPAM file) and use 'ActivePresentation'. The macros are all in the add in
    Last edited by Paul_Hossler; 04-22-2022 at 04:47 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

Posting Permissions

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