Hello!
I have the following code that opens my template and pastes my charts from on file. It works fine, but I need help formatting the image once pasted!
..... I simply can't make it format the shapes to align on the page properly! It won't take any commands to select the pasted shapes. Will someone please help me to figure out what I'm doing wrong?
Thanks!
Sub ExcelToNewPowerPoint()
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
' Create instance of PowerPoint
Set PPApp = CreateObject("Powerpoint.Application")
' For automation to work, PowerPoint must be visible
PPApp.Visible = True
' Create a presentation
Set PPPres = PPApp.Presentations.Add
PPPres.ApplyTemplate "C:\Focus_Group_Report.potx"
' Some PowerPoint actions work best in normal slide view
PPApp.ActiveWindow.ViewType = ppViewSlide
' Add first slide to presentation
Set PPSlide = PPPres.Slides.Add(1, ppLayoutBlank)
'GoTo Excel
Dim i As Integer
For i = 1 To ThisWorkbook.Sheets.Count
Sheets(i).Activate
'
Range("A1:P35").Select
'Selection.Copy
Selection.CopyPicture Appearance:=xlScreen, _
Format:=xlPicture
'ActivePresentation.Slides(i).Select
PPApp.Activate
PPApp.ActivePresentation.Slides(i).Shapes.PasteSpecial ppPasteEnhancedMetafile
Set PPSlide = PPPres.Slides.Add(i + 1, ppLayoutBlank) THIS IS WHERE I NEED TO FORMAT IT!!!!
Next i
PPApp.Activate
End Sub
Bookmarks