Thank you both for your help, although I've no doubt you're right about the
code (my programming experience is all with mainframe languages and I had
enormous difficulty finding any information about visual basic specific to
PowerPoint) changing it hasn't made any difference to my problem. When I try
to use any of the action buttons in show mode nothing happens - no error
messages, no crashes, nothing! It's as if there's no connection between the
button and the macro, so it seems reasonable to assume that there's some
problem quite independent of any inadaquacies in my code.
Am I missing something blindingly obvious in the way I'm trying to set the
buttons up? I've asked various friends and colleagues to take a look and none
of them have been able to get an action button to run a macro either, so
anything you can suggest to stop us all feeling like complete muppets would
be gratefully received.
Anne
"David M. Marcovitz" wrote:
> In addition to John's excellent advice, I'm wondering what you're doing
> with:
>
> Sub onewrong()
> With ActivePresentation.Slides(4) _
> .Shapes(1).ActionSettings(ppMouseClick)
> ..Action = ppActionRunMacro
> End With
> ActiveWindow.Selection.Unselect
> ActivePresentation.Slides.Range(Array(18)).Select
> End Sub
>
>
> You seem to be setting a button to have the action to run a macro, but
> you don't specify which macro to run. If you want to do this, you
> probably need to add
>
> ..Run = "<name of macro>"
>
> right before the End With statement to tell the button which macro to
> run.
>
> --David
>
> --
> David M. Marcovitz
> Microsoft PowerPoint MVP
> Author of _Powerful PowerPoint for Educators_
> http://www.PowerfulPowerPoint.com/
>
> =?Utf-8?B?QW5uZQ==?= <(E-Mail Removed)> wrote in
> news:2EF9935B-E7F4-457F-BB07-(E-Mail Removed):
>
> > You're more than welcome to pull my code to pieces (see below), but if
> > it was just that I'd expect some kind of error message/crash when I
> > tried to run it from the action button - at the moment it feels rather
> > like pushing a doorbell that isn't wired up!
> >
> > Thanks.
> >
> >
> > 'Define variables
> > '
> > Dim questCounter As Integer
> > Dim numIncorrect As Integer
> > '
> > 'Set variables and show first question slide
> > '
> > Sub initialise()
> > numIcorrect = 0
> > questCounter = 4
> > ActiveWindow.Selection.Unselect
> > ActivePresentation.Slides.Range(Array(4)).Select
> > End Sub
> > '
> > 'Increment incorrect answer counter
> > 'and run appropriate sub routine
> > '
> > Sub mistake()
> > numIncorrect = numIncorrect + 1
> > If numIncorrect = 1 Then
> > onewrong
> > End If
> > If numIncorrect = 2 Then
> > twowrong
> > End If
> > If numIncorrect = 3 Then
> > threewrong
> > End If
> > End Sub
> > '
> > 'Display slide for one wrong answer
> > '
> > Sub onewrong()
> > With ActivePresentation.Slides(4) _
> > .Shapes(1).ActionSettings(ppMouseClick)
> > .Action = ppActionRunMacro
> > End With
> > ActiveWindow.Selection.Unselect
> > ActivePresentation.Slides.Range(Array(18)).Select
> > End Sub
> > '
> > 'Display slide for two wrong answers
> > '
> > Sub twowrong()
> > ActiveWindow.Selection.Unselect
> > ActivePresentation.Slides.Range(Array(19)).Select
> > End Sub
> > '
> > 'Display slide for three wrong answers
> > '
> > Sub threewrong()
> > ActiveWindow.Selection.Unselect
> > ActivePresentation.Slides.Range(Array(20)).Select
> > End Sub
> > '
> > 'Increment question counter
> > 'and display next question
> > '
> > Sub nextQuest()
> > questCounter = questCounter + 1
> > ActiveWindow.Selection.Unselect
> > ActivePresentation.Slides.Range(Array(questCounter)).Select
> > End Sub
> >
>
>