View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tony Bender Tony Bender is offline
external usenet poster
 
Posts: 36
Default Excel macro that to close PowerPoint - if PPT it is open.

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,