Eurekaonide
04-18-2010, 01:43 PM
Hi All
I have managed to get my code working for Excel to open a word template and copy data across but now I need to do the same for PowerPoint and for some reason its not working. I can get it to open and populate into a blank presentation but not the specified template version so far I have the settings as the below, am I missing something??
Dim Addr As String
Dim PPApp As PowerPoint.Application
Dim Wbook As String
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
'Create instance of Powerpoint
Set PPApp = CreateObject("Powerpoint.Application")
Wbook = ThisDocument.Path & "\PPT Report R&I.pot"
'For Automation to work PowerPoint must be visible
PPApp.Visible = True
'Setting Powerpoint to Normal View
PPApp.ActiveWindow.ViewType = PPViewSlide
'Reference active slide
Set PPSlide = PPPres.Slides _
(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
I have managed to get my code working for Excel to open a word template and copy data across but now I need to do the same for PowerPoint and for some reason its not working. I can get it to open and populate into a blank presentation but not the specified template version so far I have the settings as the below, am I missing something??
Dim Addr As String
Dim PPApp As PowerPoint.Application
Dim Wbook As String
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
'Create instance of Powerpoint
Set PPApp = CreateObject("Powerpoint.Application")
Wbook = ThisDocument.Path & "\PPT Report R&I.pot"
'For Automation to work PowerPoint must be visible
PPApp.Visible = True
'Setting Powerpoint to Normal View
PPApp.ActiveWindow.ViewType = PPViewSlide
'Reference active slide
Set PPSlide = PPPres.Slides _
(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)