PDA

View Full Version : EndNamedShow in Windows 7?



blescohier
07-02-2010, 01:55 PM
Hi,

We have a presentation that includes two Custom Shows. We have macros that end a named show and return the user to the index of the presentation.

The macros work fine on XP and VIsta; we have tried on two different machines running Windows 7 and the .EndNamedShow method does not work (running PowerPoint 2007 on all platforms), nor does GoToSlide...

Here is the code:

Sub Nav_Logo()
With SlideShowWindows(1)
.View.EndNamedShow
End With
theSlideIndex = ActivePresentation.Slides("Nav_Logo").SlideIndex
ActivePresentation.SlideShowWindow.View.GoToSlide(theSlideIndex)
End Sub


As I said, this works fine on machines running XP or Vista; copy the file to a Win7 machine and it doesn't quit the Custom Show or navigate.

Has something changed in Win7 that is preventing it from working, or are we overlooking something (other macros do run; replacing EndNamedShow with Exit in the above causes the presentation to exit)?

Would stripping out the custom shows and VB and re-writing the macros and rebuilding the custom shows on the Win7 machine make any difference?

Thanks for any ideas,

-Bill

Cosmo
07-02-2010, 04:09 PM
Hi,

We have a presentation that includes two Custom Shows. We have macros that end a named show and return the user to the index of the presentation.

The macros work fine on XP and VIsta; we have tried on two different machines running Windows 7 and the .EndNamedShow method does not work (running PowerPoint 2007 on all platforms), nor does GoToSlide...

Here is the code:

Sub Nav_Logo()
With SlideShowWindows(1)
.View.EndNamedShow
End With
theSlideIndex = ActivePresentation.Slides("Nav_Logo").SlideIndex
ActivePresentation.SlideShowWindow.View.GoToSlide(theSlideIndex)
End Sub


As I said, this works fine on machines running XP or Vista; copy the file to a Win7 machine and it doesn't quit the Custom Show or navigate.

Has something changed in Win7 that is preventing it from working, or are we overlooking something (other macros do run; replacing EndNamedShow with Exit in the above causes the presentation to exit)?

Would stripping out the custom shows and VB and re-writing the macros and rebuilding the custom shows on the Win7 machine make any difference?

Thanks for any ideas,

-Bill
I don't see how the version of Windows should affect this, but I would make sure that the version of PowerPoint is exactly the same on all machines. There was a recent PowerPoint security update that has caused some problems with VBA, it's always possible that the Windows 7 machine has been updated, and the others have not, and that this is what is causing the problem. (See this thread http://vbaexpress.com/forum/showthread.php?t=32622)

To check the version, click on the 'Office Icon' in the top left, select the 'PowerPoint Options' button at the bottom, and then click on 'Resources' at the bottom left. Compare the numbers at the bottom of the window, below 'about Microsoft PowerPoint 2007'. The computers I noticed with this update read

2007 (12.0.6535.5002) SP2 MSO (12.0.6535.5002)

If the numbers are all the same, then it is possible that Win7 is to blame.

John Wilson
07-03-2010, 06:31 AM
Your code works in 2007 on seven here. Personally though I would use the ID not the name to find the slide

Use the first sub to find the ID in edit mode (which will never change) and then insert the ID in the second sub

Sub getID()
MsgBox ActiveWindow.View.Slide.SlideID
End Sub

Sub endnamed()
Dim SIndx As Long
With SlideShowWindows(1).View
SIndx = ActivePresentation.Slides.FindBySlideID(xxx).SlideIndex
.EndNamedShow
.GotoSlide (SIndx)
End With
End Sub

blescohier
07-06-2010, 08:05 PM
Okay, just created a test presentation on a Windows 7 machine... code as posted doesn't work. Changed over to navigating by slide ID as suggested, and it works. Modified the original presentation to use the ID and it is working as well... many thanks!