Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Detecting when PowerPoint is done Excel 2002

Hello All
I have a macro in Excel starting PowerPoint, running a slideshow, then
shutting down PowerPoint. It's working OK except I'm currently shutting down
PowerPoint based on time. What I would really like to do is detect when the
slideshow is over and end PowerPoint that way. I've done lots of searching
but I just can't seem to find the code I'm looking for.
Any assistance would be much appreciated,
Paul

my code

Sub SlideShow()

Dim ppApp As PowerPoint.Application
Set ppApp = CreateObject("Powerpoint.Application")

ppApp.Visible = True

Dim ppPres As PowerPoint.Presentation
Set ppPres = ppApp.Presentations.Open("C:\SlideShow.pps")
Sleep (15000)
ppApp.Quit

Application.Run "ReturntoExcel"
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Detecting when PowerPoint is done Excel 2002

Paul

Try this

Sub RunSlides()

Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation

Set ppApp = New PowerPoint.Application
ppApp.Visible = True
Set ppPres = ppApp.Presentations.Open("C:\Dick\ng\11Nov\SlideSh ow.pps")

'Loop until the last slide is the one shown
Do
DoEvents
Loop Until ppApp.SlideShowWindows(1).View.CurrentShowPosition =
ppPres.Slides.Count

Application.Wait Now + TimeValue("00:00:02") 'wait 2 seconds

ppApp.Quit

'do other stuff

End Sub

There's probably some ways to improve this. For instance, checking
ppPres.Slides.Count may not give the right result if you're using a Custom
Show. I don't know enough about PowerPoint to comment on that. Also, the
two second wait could probably be made to find the timing of the last slide
instead of two seconds. It should get you started though.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Paul" wrote in message
...
Hello All
I have a macro in Excel starting PowerPoint, running a slideshow, then
shutting down PowerPoint. It's working OK except I'm currently shutting

down
PowerPoint based on time. What I would really like to do is detect when

the
slideshow is over and end PowerPoint that way. I've done lots of searching
but I just can't seem to find the code I'm looking for.
Any assistance would be much appreciated,
Paul

my code

Sub SlideShow()

Dim ppApp As PowerPoint.Application
Set ppApp = CreateObject("Powerpoint.Application")

ppApp.Visible = True

Dim ppPres As PowerPoint.Presentation
Set ppPres = ppApp.Presentations.Open("C:\SlideShow.pps")
Sleep (15000)
ppApp.Quit

Application.Run "ReturntoExcel"
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Detecting when PowerPoint is done Excel 2002

Thanks Dick
Works great!
Paul

"Dick Kusleika" wrote in message
...
Paul

Try this

Sub RunSlides()

Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation

Set ppApp = New PowerPoint.Application
ppApp.Visible = True
Set ppPres = ppApp.Presentations.Open("C:\Dick\ng\11Nov\SlideSh ow.pps")

'Loop until the last slide is the one shown
Do
DoEvents
Loop Until ppApp.SlideShowWindows(1).View.CurrentShowPosition =
ppPres.Slides.Count

Application.Wait Now + TimeValue("00:00:02") 'wait 2 seconds

ppApp.Quit

'do other stuff

End Sub

There's probably some ways to improve this. For instance, checking
ppPres.Slides.Count may not give the right result if you're using a Custom
Show. I don't know enough about PowerPoint to comment on that. Also, the
two second wait could probably be made to find the timing of the last
slide
instead of two seconds. It should get you started though.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Paul" wrote in message
...
Hello All
I have a macro in Excel starting PowerPoint, running a slideshow, then
shutting down PowerPoint. It's working OK except I'm currently shutting

down
PowerPoint based on time. What I would really like to do is detect when

the
slideshow is over and end PowerPoint that way. I've done lots of
searching
but I just can't seem to find the code I'm looking for.
Any assistance would be much appreciated,
Paul

my code

Sub SlideShow()

Dim ppApp As PowerPoint.Application
Set ppApp = CreateObject("Powerpoint.Application")

ppApp.Visible = True

Dim ppPres As PowerPoint.Presentation
Set ppPres = ppApp.Presentations.Open("C:\SlideShow.pps")
Sleep (15000)
ppApp.Quit

Application.Run "ReturntoExcel"
End Sub






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting version of Excel being used jim37055 Excel Discussion (Misc queries) 3 October 6th 05 03:55 PM
Excel not detecting that a file is currently being edited cds_tech Excel Discussion (Misc queries) 1 June 27th 05 09:06 PM
Call up Powerpoint using Excel 2002 Paul Excel Programming 1 September 24th 04 04:02 AM
Detecting Applications Run using Excel gr8guy Excel Programming 2 August 16th 04 08:16 AM
Detecting Excel 97 using VBA Casper Hornstrup[_2_] Excel Programming 4 June 24th 04 04:28 AM


All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"