ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel macro that to close PowerPoint - if PPT it is open. (https://www.excelbanter.com/excel-programming/434756-excel-macro-close-powerpoint-if-ppt-open.html)

Tony Bender

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,

Tim Williams[_2_]

Excel macro that to close PowerPoint - if PPT it is open.
 
http://word.mvps.org/faqs/interdev/c...ptfromword.htm

Works the same way from XL

Tim


"Tony Bender" wrote in message
...
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,




Tony Bender

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

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

Thanks again,

Tony Bender



All times are GMT +1. The time now is 06:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com