Hi Guys,
I'm new here but i hope theres some VBA experts out there who can help me with this question.
Basically I am writing a code to automate various tasks in Excel and Powerpoint. The following sub pastes the selcted item into powerpoint.
what I cant figure out is how to paste the item into the second or subsequent page of the powerpoint deck. It always just pastes it into the fist slide?!?
Alternatively a code that moves the item from page 1 to page 2 would be really usefull.
Thanks to anyone who can help
bob
Public Function Paste()
'Sets up to use Powerpoint
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.slide
' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' Reference active slide
Set PPSlide = PPPres.Slides _
(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
' Paste chart
PPSlide.Shapes.Paste.Select
' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
I'm new here but i hope theres some VBA experts out there who can help me with this question.
Basically I am writing a code to automate various tasks in Excel and Powerpoint. The following sub pastes the selcted item into powerpoint.
what I cant figure out is how to paste the item into the second or subsequent page of the powerpoint deck. It always just pastes it into the fist slide?!?
Alternatively a code that moves the item from page 1 to page 2 would be really usefull.
Thanks to anyone who can help
bob
Public Function Paste()
'Sets up to use Powerpoint
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.slide
' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' Reference active slide
Set PPSlide = PPPres.Slides _
(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
' Paste chart
PPSlide.Shapes.Paste.Select
' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing