Share via

convert VBA code from excel to powerpoint

Anonymous
2019-11-21T10:12:31+00:00

what is the code to add the new slide of power point in last slide not first one

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2019-11-21T11:25:32+00:00

    https://docs.microsoft.com/en-ie/office/vba/api/powerpoint.slides.addslide

    Public Sub Add_Example()

      Dim ppApp As Object

      Dim ppPres As Object 'Presentation

      Dim pptSlide As Object 'Slide

      Dim pptLayout As Object 'CustomLayout

      Set ppApp = GetObject(, "Powerpoint.Application")

      Set ppPres = ppApp.ActivePresentation

      Set pptLayout = ppPres.Slides(1).CustomLayout

      Set pptSlide = ppPres.Slides.AddSlide(ppPres.Slides.Count + 1, pptLayout)

    End Sub

    Was this answer helpful?

    6 people found this answer helpful.
    0 comments No comments