+ Reply to Thread
Results 1 to 13 of 13

VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

  1. #1
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Not sure how many people here are into PowerPoint, but I suspect this might require VBA and I have no idea how to do this myself!

    I have a master slide. On the master slide I have a pale blue oval (not the title slide, but all subsequent slides). When it is clicked, a red cross appears over it.

    What I want is this: let's say that the object is clicked when the user progresses to slide 3 of the presentation. How can I have the red cross appear automatically on all subsequent slides? In other words, once it has been clicked, the cross remains visible for the rest of the presentation.

    The objective is to create a quiz in which the player gets lifelines (like in Who Wants to Be a Millionaire).

    Hope this is clear! Sample file attached.

    NB: I have changed the file extension from .pptx to .zip - this forum apparently does not accept either .pptx or .ppt as valid file formats! I hadn't realised.
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003, 2007, 2010 & 2013
    Posts
    18,917

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Try this code.

    Please Login or Register  to view this content.
    I have replaced the rotated plus with a multiple sign. I have no reason why 1 works and the other does not.
    I added question number so you can see the slide progression and that the cross remains.

    Note the zip file is now a pptm
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Thanks very much, Andy - I'll take a look.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Yes, that works as I'd envisaged - thanks! Now to see if I can apply the code to the real workbook.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Mmm. I have no idea which custom master slide this is or how to find out, but it's not working in my real workbook (which I can't share). There are other animations, of course, and these may be interfering.

    And now when I run your slideshow again, the cross is just appearing from the outset.

    Never mind - I can live without it.

    Thanks again for your help

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Out of curiosity, I am still fiddling around with this. I'm curious to understand the logic of the code you gave (and I have been looking online, but just can't quite piece it together from what I've found).

    Firstly, this:

    Please Login or Register  to view this content.
    How would I know that I needed the (2) after custom layouts? What does it denote? And what does the DoEvents line do?

    And then this:

    Please Login or Register  to view this content.
    Does this simply prevent the cross from appearing on the opening slide? If so, how would I also stop it from appearing on the final slide?

    All this is for interest, because the code is not working reliably, even in the sample you provided: sometimes it works, sometimes it doesn't. If I have the workbook open for a while, and then try it, it seems OK, but it won't work immediately I open the workbook. What should I be looking for to work out why?

    Sorry for the questions: I've dabbled a bit with VBA in Excel, but not enough to have any real command of it. This is the first time in PowerPoint for me.

    Thank you for any insights.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003, 2007, 2010 & 2013
    Posts
    18,917

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    To determine the index needed open Slide Master view, then count the sub slides (custom layouts). In your test example it is the second slide.

    The OnSlideShowPageChange routine catches the event raised when moving slides when in slideshowmode. It checks if this is the first slide and if it is makes the cross invisible.

    The 2 lines controlling visibility of the cross may be confusing. When I tested with the original rotated Plus sign it did not work. So I replaced the shape with the Multiple sign.

    The final part, which I don't think I mentioned, is the assignment of the DisableLifeLine macro as an action to the oval shape.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    It's very odd: I can't actually get your sample to work any longer, and I haven't changed anything in it.

    The final part, which I don't think I mentioned, is the assignment of the DisableLifeLine macro as an action to the oval shape.
    Forgive my ignorance, but how would one do this?

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    OK - so I am making progress here in that I have successfully made the cross disappear. In place of the oval I want to use an image that has been cut and pasted onto the master slide and then assign the action to this. I have dissected your sample file and cannot for the life of me find how or where you have applied an action to the oval - seems like black magic at the moment!

    If you can just guide me on this, then I think I might have cracked it.

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Excel 2016
    Posts
    9,999

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Hi Ali,

    Go into the slide master. Click on the oval shape and on the Ribbon >> Insert >> Links >> Action

    You will see half way down, Run macro and the title of the macro in the drop down box.

    Does this help?
    HTH
    Regards, Jeff

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Yes, I have just this minute realised this!!! I've now assigned the action to my image and it's all working perfectly - thank you! By working through this with a bit of trail and error and yours and Andy's guidance, I've learnt a lot. I have now got two lifelines working independently of each other. Really chuffed!!!

    Thanks again.

  12. #12
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Excel 2016
    Posts
    9,999

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    Good to hear it may have helped Ali and you're welcome.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    35,862

    Re: VBA? Making a Master Slide Object Appear on All Subsequent Slides Once Clicked

    It did. I've been creating a Who Wants to Be a Millionaire type quiz for use at school and just started obsessing about making it as easy as possible for anyone to use. I've built in all the ambient sounds used on the TV show, so I've learnt a lot about animations and sounds, too. Quite proud of myself! It doesn't take much ...

    Thanks again to you and to Andy.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1