+ Reply to Thread
Results 1 to 6 of 6

Playlist of Powerpoint Slidewhow from VBA Excel

  1. #1
    Registered User
    Join Date
    11-02-2004
    Posts
    3

    Playlist of Powerpoint Slidewhow from VBA Excel

    Hello to all,

    I have a powerpoint presentation that is way too big to be played without problems.
    So I decided to split the presentation in modules (smaller presentation) that I would like to play one after the other.
    From VBA Excel, I have the list of files and can create a powerpoint object, open a presentation and play it.

    But how to launch the next one when the first one is finished and so on.
    (I tried the Slidedog software without success, I tried to put a button linking the presentations to each other but the memory gets saturated quickly because they do not close when finisihed)

    Thanks in advance for your valuable help !

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Playlist of Powerpoint Slidewhow from VBA Excel

    No point posting example code without knowing how the current code is structured... but if the presentations are that big you're going to have to load the 1st, run the slideshow, unload it and then repeat with the 2nd, 3rd ...

  3. #3
    Registered User
    Join Date
    11-02-2004
    Posts
    3

    Re: Playlist of Powerpoint Slidewhow from VBA Excel

    Thank for your quick answer.

    The VB Code in each PPT file is the following

    Please Login or Register  to view this content.
    The result should have been a continuous show but it doesn't work and the memory seems not be cleared (the pb I face with the big file not splitted).

    Is that more clear ?

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Playlist of Powerpoint Slidewhow from VBA Excel

    Can't comment further - you are closing the first slideshow, but I'd be curious if the line to open the next actually executes... (I don't have a use for PowerPoint, thankfully, so it was 'disappeared').

  5. #5
    Registered User
    Join Date
    11-02-2004
    Posts
    3

    Re: Playlist of Powerpoint Slidewhow from VBA Excel

    Thanks.
    I try to post my problem differently
    From Excel VBA I can pilot Powerpoint : I am able to launch a powerpoint presentation.
    How can I execute a line of code when the presentation is finished (I mean is closed / have reached the end slide) ?
    Thanks again
    Last edited by freddybee; 05-17-2022 at 05:01 PM.

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Playlist of Powerpoint Slidewhow from VBA Excel

    Your code is using constants defined in Powerpoint so will assume you're using early binding (You have a reference to PowerPoint in the Project Tools\References menu and you declare your PP object as 'PowerPoint.Application', not as a generic object.

    If so, you can declare the PP object using 'WithEvents' which will cause PowerPoint to raise its events in the VBA project and you can trap the PowerPoint Application.SlideShowEnd event to start the next presentation.

    The only problem is you can only use WithEvents in an object module, not a standard code module. Object modules are the Workbook & Worksheet classes in the project explorer, any userform or a user created Class.

    Let's go with a userform...
    Please Login or Register  to view this content.
    You will now also have a 'PP' object in the dropdown top left of the code window (because of the 'WithEvents')

    Select That and in the right hand dropdown select the SlideShowEnd event. VBA will add the event stub as usual. In that you unload the active presentation and load/run the new.

    Like I said, I don't have PowerPoint so comments rather than code...
    • Check the name of the active presentation (he one just finished)
    • Use that to determine the name of the next
    • Unload the active presentation
    • Load and run the new

    Typed freehand so no guarantee that the little bit of code there will even compile, but that'd be the general idea....

    Edit: just realised, this code is from PowerPoint not Excel, so you must add a reference to PowerPoint using the project Tool\References menu
    Last edited by cytop; 05-17-2022 at 11:43 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] copy past table from excel to powerpoint - keep powerpoint formatting
    By djc225 in forum PowerPoint Formatting & General
    Replies: 2
    Last Post: 10-30-2018, 11:32 AM
  2. Replies: 0
    Last Post: 08-23-2016, 09:43 AM
  3. Replies: 1
    Last Post: 06-09-2016, 12:05 PM
  4. Replies: 6
    Last Post: 08-18-2015, 06:39 AM
  5. Excel/PowerPoint VBA teaser: How to change data labels in PowerPoint chart by VBA?
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2015, 11:47 AM
  6. VBA Transfer Range from Excel to Powerpoint (New or Existing Powerpoint Presentation)
    By ThePeoplesClub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2014, 02:52 PM
  7. Excel power toy for media playlist...
    By Frank in forum Excel General
    Replies: 1
    Last Post: 08-29-2005, 02:05 AM

Tags for this Thread

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