VBA macros in PowerPoint 2007 wont run

A

asa.holmgren

My PowerPoint VBA macros fails to run. The macros is saved in a
template (.potm). I have created a button on the Ribbon to run the
code from my presentations. The macros run when the template itself is
opened, but when I create a new presentation based on the template the
macro fails to run. The error message states that the macro can not be
found or has been disabled. I have the lowest possible macro security
set.

I have inserted this Ribbon XML in the template using the Office 2007
Custom UI Editor:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
xmlns:dicentia="DicentiaTemplates" >
<ribbon>
<tabs>
<tab idMso="TabHome">
<group id="myGroup" label="Test group">
<button id="presentationButton" label="ShowDialog"
imageMso="ViewsFormView" onAction="ButtonClick" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

The macro in the potm-file looks like this and is contained in a
standard module:

Public Sub ButtonClick(control As IRibbonControl)
Select Case control.Id
Case "presentationButton"
frmMain.Show vbModal
End Select
End Sub

I have made exactly the same in Word 2007 and it works fine!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top