Problem with PowerPoint Slides.AddSlide Method RRS feed

  • Question

  • I'm trying to develop a VBA script that will select slides from one PowerPoint presentation and add them to a new presentation. Here's the code from the Sub that creates the new presentation:

    Private Sub BuildDeck()
    Dim objPresentation As Presentation
    Dim pptSlide As Slide

    Set slide1 = ActivePresentation.Slides(1).Duplicate

    Set pptLayout = ActivePresentation.Slides(1).CustomLayout
    Set objPresentation = Presentations.Add(True)
    Set pptSlide = objPresentation.Slides.AddSlide(1, pptLayout)

    End Sub

    When I run it I get the message Slides (unknown member) : Bad return argument.

    Any thoughts about what is causing this?


    Wednesday, October 28, 2020 4:32 PM