Trying to exit running slide show using VBA code

S

shane-t

I have a routine that I need to run automatically, but it needs the running
slideshow to close to run, so I've been trying to use
ActivePresentation.SlideShowWindow.View.Exit within the routine
OnSlideShowPageChange()
to do that.
It appears to work fine, the running show exits, but after a couple of
seconds, Powerpoint crashes and I get the screen asking me would I like to
send the error report to Microsoft. This is driving me nuts, anyone got any
ideas why this happens, or know of some other way to stop the presentation
using vba code?
 
S

shane-t

Sub ExitAllShows()
Do While SlideShowWindows.count > 0
SlideShowWindows(1).View.Exit
Loop
End Sub

Is the routine I'm using. I get a sub to check a text file to see if it
contains a 1 and if it does, the slide show exits

.......
Open y For Input As #1
Line Input #1, tmpStr
Close #1

'Test text we read from file
Dim test As Integer
test = InStr(tmpStr, "1")


If test = 1 Then
Call ExitAllShows


End If
.........



This Checking routine is called from the following routine

Sub OnSlideShowPageChange()

Call checkUpdate

EndSub


Thanks,
Shane
 

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