I am able to copy the content from powerpoint but getting an error while pasing it on another powerpoint.
Error is on this line
pres2.Slides.Paste Index:=pres2.Slides.Count + 1
Dim OutApp As Object
Dim fileNameString As String
Dim NewSlide As Slide
Dim i As Integer
Dim Nstring As String
Dim Nstring1 As String
Dim Allshape As Object
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 pres1 = pp.Presentations.Open(Sheet1.TextBox1.Text)
Set pres2 = pp.Presentations.Open(Sheet1.TextBox2.Text)
Set NewSlide = pres1.Slides(2)
Set Allshape = NewSlide.Shapes
Allshape.Range.Copy
pres2.Slides.Paste Index:=pres2.Slides.Count + 1
question from:
https://stackoverflow.com/questions/65897512/copy-content-from-powerpoint 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…