View Full Version : Remove Advance Slide on 300+ powerpoint files
abenitez77
01-12-2018, 06:48 AM
I have about 300 powerpoint files that have advance slide timer on them and I want to remove them so that it does not advance when I open them. How can I do this with vba, so i don't have to open each one individually to do this?
John Wilson
01-16-2018, 07:59 AM
IF you mean slides are set to advance on time not on click
Put a COPY of some of the files in a folder called PPTFILES on your desktop and try this code.
Sub Not_Auto()
Dim opres As Presentation
Dim strFile As String
Dim strFolder As String
Dim strSpec As String
Dim osld As Slide
strSpec = "*.pp*"
strFolder = Environ("USERPROFILE") & "/Desktop/PPTFILES/"
strFile = Dir$(strFolder & strSpec)
While strFile <> ""
Set opres = Presentations.Open(strFolder & strFile)
Set osld = opres.Slides(1)
osld.Select
If Not CommandBars.GetPressedMso("SlideTransitionOnMouseClick") Then _
CommandBars.ExecuteMso ("SlideTransitionOnMouseClick")
DoEvents
If CommandBars.GetPressedMso("SlideTransitionAutomaticallyAfter") Then _
CommandBars.ExecuteMso ("SlideTransitionAutomaticallyAfter")
DoEvents
CommandBars.ExecuteMso ("SlideTransitionApplyToAll")
DoEvents
opres.Save
opres.Close
strFile = Dir()
Wend
End Sub
abenitez77
01-16-2018, 03:20 PM
IF you mean slides are set to advance on time not on click
Put a COPY of some of the files in a folder called PPTFILES on your desktop and try this code.
Sub Not_Auto()
Dim opres As Presentation
Dim strFile As String
Dim strFolder As String
Dim strSpec As String
Dim osld As Slide
strSpec = "*.pp*"
strFolder = Environ("USERPROFILE") & "/Desktop/PPTFILES/"
strFile = Dir$(strFolder & strSpec)
While strFile <> ""
Set opres = Presentations.Open(strFolder & strFile)
Set osld = opres.Slides(1)
osld.Select
If Not CommandBars.GetPressedMso("SlideTransitionOnMouseClick") Then _
CommandBars.ExecuteMso ("SlideTransitionOnMouseClick")
DoEvents
If CommandBars.GetPressedMso("SlideTransitionAutomaticallyAfter") Then _
CommandBars.ExecuteMso ("SlideTransitionAutomaticallyAfter")
DoEvents
CommandBars.ExecuteMso ("SlideTransitionApplyToAll")
DoEvents
opres.Save
opres.Close
strFile = Dir()
Wend
End Sub
Will this run on a MAC?
John Wilson
01-17-2018, 01:16 AM
No, but did you say you had a mac?
abenitez77
01-17-2018, 04:56 AM
I think it's obvious I did not, but I guess I should have. So the now obvious question is, is there a way to do what I want on a MAC or do i need to move the files to a pc and run it there then copy the files back?
John Wilson
01-17-2018, 05:04 AM
You should have and then I wouldn't have wasted an hour!
On a Mac I think you would need to use AppleScript but I am not a Mac programmer.
If you have a PC I would try it there with a few files only to start with.
abenitez77
01-17-2018, 09:43 AM
You should have and then I wouldn't have wasted an hour!
On a Mac I think you would need to use AppleScript but I am not a Mac programmer.
If you have a PC I would try it there with a few files only to start with.
John, your time is not wasted. I will be copying the files to a laptop with windows and using your code, then copying the files back to the mac. I am not a mac programmer either.
Thanks for your expertise and time!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.