LSUchamp06
New Member
- Joined
- Apr 16, 2021
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hey y'all,
I attempting to write a macro that will automate copying and pasting Excel ranges to PowerPoint as linked picture objects. Below is what I have thus far. Any help whatsoever would be appreciated.
Sub Excel_Range_to_PowerPoint()
'Declare PowerPoint Variables
Dim papp As PowerPoint.Application
Dim pppt As PowerPoint.Presentation
Dim psld As PowerPoint.Slide
'Open existing PowerPoint File
Set papp = New PowerPoint.Application
Set pppt = papp.Presentations.Open("c:\users\bsegura\desktop\P3 - ARH Financial Results - FINAL-copy.pptx")
'Select Excel range and copy, paste link, Microsoft Object
Sheets("Month vs PY-CONSOL").Select
Range("A9:R56").Select.CopyPicture Appearance:=xlScreen, Format:=xlPicture
psld.Shapes.PasteSpecial(DataType:=ppPastePNG).Select
With papp.ActiveWindow.Selection.SlideRange(2)
LockAspectRatio = msoFalse
.Height = 5.07
.Width = 5.13
.Top = 0.97
.Left = 0.05
End With
End Sub
I attempting to write a macro that will automate copying and pasting Excel ranges to PowerPoint as linked picture objects. Below is what I have thus far. Any help whatsoever would be appreciated.
Sub Excel_Range_to_PowerPoint()
'Declare PowerPoint Variables
Dim papp As PowerPoint.Application
Dim pppt As PowerPoint.Presentation
Dim psld As PowerPoint.Slide
'Open existing PowerPoint File
Set papp = New PowerPoint.Application
Set pppt = papp.Presentations.Open("c:\users\bsegura\desktop\P3 - ARH Financial Results - FINAL-copy.pptx")
'Select Excel range and copy, paste link, Microsoft Object
Sheets("Month vs PY-CONSOL").Select
Range("A9:R56").Select.CopyPicture Appearance:=xlScreen, Format:=xlPicture
psld.Shapes.PasteSpecial(DataType:=ppPastePNG).Select
With papp.ActiveWindow.Selection.SlideRange(2)
LockAspectRatio = msoFalse
.Height = 5.07
.Width = 5.13
.Top = 0.97
.Left = 0.05
End With
End Sub