work4livinsean
Programmer
Hello everyone, I am having a problem activating a powerpoint window from a VBA in excel. I have a couple pieces of code but nothing happens when I run it. Can someone please help me with this, thanks:
Sub ChangeToPower()
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
UpdateScreen = True
' 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)
'**Here are 3 things I have tried, cannot get any to work right**
PPApp.ActiveWindow("Filename.ppt").Activate
PPPres.Windows(1).Activate
PPSlide.Application.Windows(1).Activate
End Sub
Thanks in advance.
Sub ChangeToPower()
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
UpdateScreen = True
' 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)
'**Here are 3 things I have tried, cannot get any to work right**
PPApp.ActiveWindow("Filename.ppt").Activate
PPPres.Windows(1).Activate
PPSlide.Application.Windows(1).Activate
End Sub
Thanks in advance.