Excel macro that to close PowerPoint - if PPT it is open.

T

Tony Bender

I have an Excel application that enable the user to export an Exccel
chart directly into PowerPoint. The macro to do this works fine
provide PowerPoint wasn't already open.

I am trying to figure the VB code so when the application opens it
automatically closes PowerPoint - if in fact PowerPoint is already
open.

Here's what I have so far but I'm getting errors ("ActiveX component
can't create object):

Sub Workbook_Open()
Dim PPApp as PowerPoint.Application
Set PPApp = PowerPoint.ActivePresentation

With PPApp
.Saved = msoTrue
.Close
end with

UF1.show
End Sub

Can anyone point me in the right direction?

Thank you,
 
T

Tony Bender

Tim,

Thank you for you suggestion...it solved my problem..

Thanks again,

Tony Bender
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top