Close Application code or macro?

cavscout

Registered User.
Local time
Yesterday, 19:22
Joined
Mar 13, 2003
Messages
74
I'm opening powerpoint from access to display a powerpoint presentation. At the end of the presentation the viewer clicks a button to return to Access and view other presentations.

The problem is Powerpoint stays open.

I need a way to close powerpoint when the presentation is over or before the next presentation is started.

I know Access will open an external application but I don't see a way to close an external application.

Any help is apreciated.
 
post the code so we can see if you are closing the objects or how you are closing them!
 
I think I found a solution.

Dim appPPt As PowerPoint.Application

' Set a reference to the PowerPoint Application object.
Set appPPt = New PowerPoint.Application

If appPPt.Visible = True Then
' Close the previous presentation.
appPPt.ActivePresentation.Close

' Quit PowerPoint
appPPt.Quit

' Close the object reference.
Set appPPt = Nothing

' Set a reference to the PowerPoint Application object.
Set appPPt = New PowerPoint.Application

' Display the application.
appPPt.Visible = True

' Open Company Intro Presentation.
appPPt.Presentations.Open "C:\PowerPointDocs\CompanyIntro.pps"

Else

' Set a reference to the PowerPoint Application object.
Set appPPt = New PowerPoint.Application

' Display the application.
appPPt.Visible = True

' Open Company Intro Presentation.
appPPt.Presentations.Open "C:\PowerPointDocs\CompanyIntro.pps"
End If
End Sub

If there is a better way please advise.

Thanks for your response.
 
Dim appPPt As PowerPoint.Application

' Set a reference to the PowerPoint Application object.
Set appPPt = New PowerPoint.Application

If appPPt.Visible = True Then
' Close the previous presentation.
appPPt.ActivePresentation.Close

' Quit PowerPoint
appPPt.Quit

' Close the object reference.
Set appPPt = Nothing

' Set a reference to the PowerPoint Application object.
Set appPPt = New PowerPoint.Application

' Display the application.
appPPt.Visible = True

' Open Company Intro Presentation.
appPPt.Presentations.Open "C:\PowerPointDocs\CompanyIntro.pps"

Else

' Set a reference to the PowerPoint Application object.
Set appPPt = New PowerPoint.Application

' Display the application.
appPPt.Visible = True

' Open Company Intro Presentation.
appPPt.Presentations.Open "C:\PowerPointDocs\CompanyIntro.pps"
End If

' Close the object reference.
Set appPPt = Nothing
End Sub :)
 

Users who are viewing this thread

Back
Top Bottom