Copy Range into PowerPoint

tsm1111

New Member
Joined
Sep 26, 2011
Messages
11
I am trying to do something very simple but running into a problem with pasting. I am a VBA novice. Please see the code below. I have the reference to Microsoft PowerPoint Object library set up. Everything works util the paste step.

Sub PowerPoint()
'creates new instance of powerpoint
Dim ppApp As Object
Dim ppPres As PowerPoint.Presentation
Dim ppSlide As PowerPoint.Slide


Set ppApp = CreateObject("PowerPoint.Application")
ppApp.Visible = True
ppApp.Activate


'cretae presentation
Set ppPres = ppApp.Presentations.Add


Set ppSlide = ppPres.Slides.Add(1, ppLayoutTitle)


ppSlide.Shapes(1).TextFrame.TextRange = "Title"
ppSlide.Shapes(2).TextFrame.TextRange = "by First Last"


Set ppSlide = ppPres.Slides.Add(2, ppLayoutBlank)


ppSlide.Select


Range("C3:H8").Copy


ppSlide.Shapes.Paste


End Sub
 
How do I set that up?

I'm not sure what you mean. Can you please elaborate?

If your version works, my version should also work. And, if you want to create a link to the source file...

Code:
ppSlide.Shapes.PasteSpecial DataType:=ppPasteOLEObject, Link:=msoTrue

Or, without using named arguments...

Code:
ppSlide.Shapes.PasteSpecial ppPasteOLEObject, , , , , msoTrue
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,215,967
Messages
6,127,980
Members
449,414
Latest member
sameri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top