By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

Become an Σxpert at Σxcel.com

 


GetActivePPT - Function to return a reference to the Active powerpoint


Function GetActivePPT() As Object
'set a VBE reference to Microsoft Powerpoint Object Library
'To call
'  ---> Dim ppt As PowerPoint.Application
'  ---> Set ppt = GetActivePPT
''''''''''''''''''''''''''''''''
Dim PPApp as PowerPoint.Application
On Error Resume Next
'Reference existing instance of powerpoint
Set PPApp = GetObject(,"PowerPoint.Application")
If PPApp Is Nothing Then
    Set PPApp = New PowerPoint.Application
End if
PPApp.Visible = True
'Reference Active Presentation
Set GetActivePPT = PPApp

End Function