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...
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
Bookmarks