How can you write code in PowerPoint 2007 to be able to click on a command button to end the slide show. I know you can add a hyperlink to do this but this is not versatile enough because I wish to add in several msgbox commands as well before quitting the slide show. I have tried the following code but it does not work for me, even when saved as a macro-enabled PowerPoint 2007.

Code:
Msgbox "whatever"
With ActivePresentation.Slides(1).Shapes(3) _
        .ActionSettings(ppMouseClick)
    .Action = ppActionEndShow
    .AnimateAction = True
End With
I have checked my security settings to run macros. What have I done wrong?