Share via

PowerPoint Ribbon XML fails to trigger VBA macro in .potm (Macro not found/disabled)

Hans Kristian Eide 0 Reputation points
2026-03-19T14:33:07.42+00:00

Hi,

I am struggling with a custom Ribbon tab in a PowerPoint macro-enabled template (.potm). The tab and button appear correctly, but clicking the button triggers the error: "Cannot run the macro. The macro may not be available in this workbook or all macros may be disabled."

Environment:

File type: .potm (placed in a Trusted Location)

  • VBA Project Name: Renamed (No spaces/special chars)

Module Name: modBackground (Unique name)

What we have tried (all failed):

Callback Signatures: Verified onAction="MyMacro" in XML matches Public Sub MyMacro(control As IRibbonControl) in a standard module.

Simplified Test: Tried a basic MsgBox "Hello" macro with no logic – same error.

Late Binding: Changed signature to (control As Object) to rule out reference issues.

Explicit Pathing: Tried onAction="modBackground.MyMacro" in XML.

References: Confirmed Microsoft Office 16.0 Object Library is active. No "MISSING" references.

XML Namespaces: Tested both 2006/01 and 2009/07 schemas.

Macro Visibility: The macro is not visible in the Alt+F8 list (as expected for macros with arguments), but a test macro without arguments in the same module is visible and runs fine manually.

It seems like the Ribbon engine is unable to "handshake" with the VBA engine despite the file being in a Trusted Location and macros being enabled.

Has anyone encountered this specific behavior in PowerPoint where the Ribbon refuses to find valid VBA callbacks in a template?

Developer technologies | Visual Basic for Applications
0 comments No comments

3 answers

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 16,040 Reputation points Microsoft External Staff Moderator
    2026-03-20T09:13:01.2033333+00:00

    Hi @Hans Kristian Eide ,

    I completely understand how frustrating this must be, it really makes sense to expect .potm to behave like Word or Excel templates. The limitation is that PowerPoint only copies slides and layout when creating a new file from a template, so macros stay in the template and the Ribbon can’t call them.

    I know this isn’t ideal, and unfortunately there’s no way to make .potm carry macros automatically. The practical options are using a .pptm or a .ppam add-in.

    If you’d like to let the PowerPoint team know this is important, you can submit a feature request through Feedback Hub, press Win + F to open it.

    enter image description here

    If my explanation was helpful to you, I’d appreciate it if you could follow the instructions here so others with the same problem come across this answer will know and send their own feedback. Every bit of feedback helps improve these kinds of features.

    1 person found this answer helpful.
    0 comments No comments

  2. Jack Dang (WICLOUD CORPORATION) 16,040 Reputation points Microsoft External Staff Moderator
    2026-03-20T05:31:02.3333333+00:00

    Hi @Hans Kristian Eide ,

    Thanks for reaching out.

    PowerPoint sometimes can’t find macros with parameters in templates if the module or project names are referenced in the XML. You can follow these steps:

    1. Keep the macro in a standard module and declare it as Public Sub MyMacro(control As IRibbonControl).
    2. Use just the macro name in XML: onAction="MyMacro" (avoid including the module name).
    3. Ensure the module and project names are simple, with no spaces or special characters.
    4. Restart PowerPoint after making changes to register the Ribbon callbacks.

    If my answer was helpful, I’d appreciate it if you could follow the instructions here so others with the same problem can benefit as well.

    1 person found this answer helpful.

  3. Q&A Assist
    2026-03-19T14:33:32.44+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    PowerPoint ribbon callbacks must meet the same basic rules as other Office ribbon callbacks, but the context only provides generic guidance for macros and security, not PowerPoint-specific ribbon behavior. From the available information, only the following points are supported:

    1. The macro must be in a macro-enabled file
      • VBA code and ribbon callbacks can only run from macro-enabled files. For PowerPoint this means using a macro-enabled format such as .pptm, .potm, .ppam, or .ppsm.
      • Using a .potm template is valid for storing macros and ribbon callbacks.
    2. Macros must not be blocked by security
      • To run VBA code, macro security must allow it. In a testing environment, macro settings can be relaxed, but this should be done only temporarily:
        • File → Options → Trust Center → Trust Center Settings → Macro Settings.
        • For testing, “Enable all macros” will allow all VBA to run, including unsigned code. After testing, macro settings should be returned to a safer option such as “Disable all macros with notification” or “Disable all macros except digitally signed macros”.
      • The file must be saved as a macro-enabled file type; otherwise, macros will not run even if the code is present.
    3. Trusted Locations and add-ins
      • Running unsigned code or add-ins is controlled by Trust Center settings. For COM/add-ins, the options “Require Application Add-ins to be signed by Trusted Publisher” and “Disable all Application Add-ins” must be cleared to allow them to load. Although this is described for COM add-ins, the same Trust Center is where macro behavior is controlled.
    4. General macro execution and visibility
      • Macros that take parameters (such as ribbon callbacks) do not appear in the standard macro list (Alt+F8), while parameterless macros do. This matches the behavior described: a test macro without arguments appears and runs manually, while the callback macro does not.
      • Macros and VBA modules can be inspected and edited via the Visual Basic Editor (Alt+F11) once the Developer tab is enabled.

    Given the context, the key supported checks are:

    • Confirm the file is saved as a macro-enabled PowerPoint format (.potm, .pptm, .ppsm, or .ppam).
    • Confirm macro security in Trust Center allows macros to run (temporarily “Enable all macros” for testing, then revert to a safer setting).
    • Ensure the file is opened from a location that is not blocked by Trust Center settings.

    If these conditions are met and the callback signature matches the ribbon XML, the remaining behavior is not covered by the provided documentation and would require additional, product-specific guidance beyond the context.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.