With the below coding, I am able to add new slide in PowerPoint. Macro is running without any error.
The only problem I am facing is related to layout.
There are options in layout in PowerPoint and I want to use 'Title and Content' layout for newly added slide. Please assist.
Dim pres1 As PowerPoint.Presentation, pres2 As PowerPoint.Presentation, pp As Object
On Error Resume Next
Set pp = GetObject(, "PowerPoint.Application")
If Err.Number <> 0 Then Set pp = CreateObject("PowerPoint.Application")
On Error GoTo 0
Set pres2 = pp.Presentations.Open(Sheet1.TextBox2.Text)
Set NewSlide = pres2.Slides.Add(Index:=2, Layout:=ppLayoutCustom)
question from:
https://stackoverflow.com/questions/65900868/excel-vba-to-add-slide-with-layout-title-and-content 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…