Hi everybody
I'm trying to copy a range from a worksheet, and paste it "Linked to the source".
I have a Power Point file with 2 blank slides named Test.pptx
The partial code I post here copies a first range and pastes it by default conditions, and goes OK
the second range, I try to paste and link to the source, but I only get error
I've tried diferent options I found over the web, but no one works.
It must be something simple I'm mistaking.
Your help will be very appreciatedSub CopyToPpt() Dim PPt As PowerPoint.Application Dim mySlide As PowerPoint.Slide Set PPt = New PowerPoint.Application PPt.Visible = True PPt.Presentations.Open Filename:="C:\Users\vp\Desktop\Test.pptx" Set mySlide = PPt.ActivePresentation.Slides(1) mySlide.Select Sheets("Hoja1").Range("B2:E5").Copy mySlide.Shapes.Paste Set myForm = mySlide.Shapes(mySlide.Shapes.Count) myForm.Left = 50 myForm.Top = 150 Application.CutCopyMode = False PPt.Visible = True Set mySlide = PPt.ActivePresentation.Slides(2) mySlide.Select Sheets("Hoja2").Range("B6:E15").Copy mySlide.Shapes.PasteSpecial(Link:=True).Select 'Here is the error message Set myForm = mySlide.Shapes(mySlide.Shapes.Count) myForm.Left = 50 myForm.Top = 150 Set PPt = Nothing Set mySlide = Nothing End Sub
Bookmarks