• Run a Macro on Slide Open (PP97)

    Author
    Topic
    #358615

    Hi folks,

    Anyone know how to run a macro automatically when an individual slide opens during a Show – i.e. VBA command?

    Can do this with click’able hyperlink obviously, but can it be done automatically?

    Thanks in advance,

    Ade

    Viewing 1 reply thread
    Author
    Replies
    • #535491

      Don’t know about automatically, but you can improve on the ‘clickable’ hyperlink by setting up a ‘mouse over’ hyperlink.
      Make sure your macro exists in PowerPoint.
      Draw rectangle over the whole slide; with the rectangle selected, click on Slide Show | Actions Settings and click on the mouse over tab. Set it up to run the macro, OK it and then change the rectangle properties to No Fill and No Line.
      Now, when the slide show is running, you can just shake the mouse to wake up the pointer and it will run the macro (because the whole slide is ‘active’ because of the invisible rectangle)
      Not quite what you wanted, but it might help.
      Cheers cheers

      • #535505

        That’s a cheeky little work around – nice thinking.

        I’ll keep my options open just now though – the slide show I’m working on is an unattended display at a conference – i.e. there might not be a mouse to move!

        Thanks for your help,

        Ade

        • #535627

          Thought of this last night. If the unit may not even have a mouse (or keyboard?), how are you going to start/run the computer or presentation? I’ll assume you have that figured out.

          I also realize this may miss you entire point as to run a macro upon viewing a certain slide. You may want to post this in the VBA forum.

          So, Why not set up the presentation the way you want it to run, including looping and save it as a “PPS” file. Then place a shortcut to that file in the starup folder? This way when the computer boots, your presentation would run.

          • #535628

            I’ll try posting orginal in VBA forum.

            Thanks for your thinking on the lack of keyboard/mouse – pps is the obvious solution, but as you say – this doesn’t address the issue of runing a macro upon viewing a certain slide.

            Cheers,

            Ade

    • #535661

      What do you want to have happen?

      • #535788

        When, lets say, the last slide opens (during a Show) I want it to automatically call a VBA procedure – without the viewer having to click a hyperlink etc.

        Ade

        • #535966

          Would it work if you launched the slide show via a vba process and had it count the slides in the show – waiting until the chosen slide was active to launch the next macro?

          Unfortunately, I don’t know enough about PPT’s VBA model to actually do this you understand. grin

          Cheers

          • #536137

            That’s a distinct possibility – but, likewise, I’m an Access and Word VBA chap and don’t know the PP module well either.

            I may give it a go, but the slide in question is, in effect, an add-in – i.e. I’m designing an info request user form that links to backend database; I intend for it to be made available to anyone in our company that wants to use it. Hence, I won’t know what slide number it will be in their presentations?

            Thanks for your help.

            Ade

            • #536150

              In trying to piece together your true final product, I understand that you’re trying to run a presentation in a Kiosk, most likely without any other human intervention. Yet at a given point, the last slide at this point, you want to ‘branch’ somewhere else. It sounds like this is a base presentation design that various other departments will use in different ways, thus have a different slide count. Is that up to date?

              What is this other data you’re jumping to?

              Why can’t you use a touch screen and put a hyperlink on the last page? There are several manufacturers that produce touch screen monintors as well as companies like ">Javelin Computers that produce touch screen PC’s.

              The next thought would then be to build a larger “one roof” application and allow users to use the touch screen to navigate.

            • #536172

              In order…

              Yes, you’re spot on.

              Access Database to record information requests from viewers of the presentation.

              Touch screens are very “nice”, but beyond the realms of our company.

              Thanks for your ideas, but I think I’m going to stick with a clickable/mouse-over hyperlink.

              ==================

              Unless anyone knows the VBA code for what I need…then I think we’ve exhausted this thread – it appears to be beyond the PP VBA module.

              Many thanks and until next time…

              Regards,

              Ade

            • #536885

              It would appear that PP does not expose the slide event in VBA (see this post).

              Ade

            • #541471

              I’m taking this from the help file in PPT:

              SlideShowWindow Property Example

              The following example shows the Click event procedures for buttons named “cmdBack” and “cmdForward”. If you add these buttons to the slide master and add these event procedures to them, all slides based on the master (and set to show master background graphics) will have these navigation buttons that will be active during a slide show. The Me keyword returns the Master object that represents the slide master that contains the control. If the control were on an individual slide, the Me keyword in an event procedure for that control would return a Slide object.

              Private Sub cmdBack_Click()
              Me.Parent.SlideShowWindow.View.Previous
              End Sub

              Private Sub cmdForward_Click()
              Me.Parent.SlideShowWindow.View.Next
              End Sub


              This sounds a little like want you wanted to do and yes, I was able to put command buttons on the master that would run the macro while in the slide show.

              BTW once you place the command buttons on the master – the master object is visible (exposed?) in the Visual Basic Editor.

              Cheers

    Viewing 1 reply thread
    Reply To: Run a Macro on Slide Open (PP97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: