VBA Code: Remove Animations in PowerPoint

Created: Friday, July 20, 2012, posted by at 4:05 am


Do you want to remove all animations from your slides? You may want to remove animations for a variety of reasons: maybe the sequencing is all messed up, and starting all over again seems like a great idea. But one look at your Animations task pane reveals tens or hundreds of animations on each slide. Is there a magic button somewhere in PowerPoint that can get rid of all animations altogether?

Yes, you can do this easily in PowerPoint using some simple VBA code, as John Wilson of PowerPoint Alchemy explains. John adds that this only removes animations from individual slides, and not any animations added within the Slide Master.

First, you need to know how you can run VBA scripts in PowerPoint — then use this code. Explore the code a bit though since John has put in some helpful comments so that you can edit some values as required.

Sub Zap_Animations() 
Dim oeff As Effect 
Dim i As Integer 
Dim t As Integer 
Dim osld As Slide 
'Remove normal animations
For Each osld In ActivePresentation.Slides 
For i = osld.TimeLine.MainSequence.Count To 1 Step -1 
osld.TimeLine.MainSequence(i).Delete 
Next i 
'Remove triggers
For i = osld.TimeLine.InteractiveSequences.Count To 1 Step -1 
For t = osld.TimeLine.InteractiveSequences(i).Count To 1 Step -1 
osld.TimeLine.InteractiveSequences(i).Item(t).Delete 
Next t 
Next i 
Next osld 
End Sub

Once you have placed this code in the VBA editor, close the window to get back to your PowerPoint slides. Before you proceed further, it’s a great idea to save your file — be sure to save as a PowerPoint Macro-Enabled Presentation with the PPTM file extension or PowerPoint Macro-Enabled Show with the PPSM extension. If you save as any of the other file formats, PowerPoint will offer to remove the macros, and then of course the Zap_Animations macro will not work! See our PowerPoint File Formats page to learn about these file formats.

Thereafter run the macro — more info can be found in our Use Macros and Scripts in PowerPoint tutorial.

Thank you so much, John.

We tested this code using PowerPoint 2010 for Windows.

Remove Animations in PowerPoint

You May Also Like: What is VBA? | Resources on PowerPoint Programming and VBA | Use VBA in PowerPoint, Even if You Can’t Program for Nuts


John Wilson

John Wilson is a Microsoft PowerPoint MVP who creates some cool add-ins for PowerPoint. He participates in the PowerPoint newsgroups and runs the PPTAlchemy site. John is based out of the UK and loves to hear from PowerPoint users about concepts and ideas to create even more PowerPoint add-ins!

The views and opinions expressed in this blog post or content are those of the authors or the interviewees and do not necessarily reflect the official policy or position of any other agency, organization, employer, or company.



Related Posts

  • VBA Code: Paste in Place
    Ever tried copying an object in PowerPoint and found it refuses to sit still when pasted? Instead of landing neatly atop the original—like a twin retu...
  • VBA Code: Change Linked Videos to Embedded?
    Have you created or inherited a PowerPoint file that contains a linked video file that you want to share with others? Wouldn't it be easier if you cou...
  • VBA Code: Remove Underlines from Descenders
    First a little history. This started with our Stop Underlining Your Descenders! article. Of course, as per that article you can manually remove under...
  • VBA Code: Change Embedded Videos to Linked?
    No Longer Working?This code no longer works in PowerPoint and is retained for archival reasons.Have you created a huge monster PowerPoint file that's ...

Filed Under: Programming
Tagged as: , , , ,

3 Comments

3 responses to “VBA Code: Remove Animations in PowerPoint”

  1. Unknown says:

    Nice script–I have been tasked with removing animations and transitions from large PPTs before converting to Adobe Presenter, and I found this modified script helpful. I found that some slides still had animations because their Master Slide had animations.
    Sub RemoveTransAndAnimations()
    Dim osld As Slide
    Dim i As Integer
    For Each osld In ActivePresentation.Slides
    'Remove Animations
    With osld.TimeLine.MainSequence
    For i = .Count To 1 Step -1
    .Item(i).Delete
    Next i
    End With
    'Remove triggers
    For i = osld.TimeLine.InteractiveSequences.Count To 1 Step -1
    For t = osld.TimeLine.InteractiveSequences(i).Count To 1 Step -1
    osld.TimeLine.InteractiveSequences(i).Item(t).Delete
    Next t
    Next i

    'Remove transitions
    osld.SlideShowTransition.EntryEffect = ppEffectNone
    ' Remove Master Slide animations
    With osld.Design.SlideMaster.TimeLine.MainSequence
    For i = .Count To 1 Step -1
    .Item(i).Delete
    Next i
    End With
    ' Remove Master Slide Transitions
    osld.Design.SlideMaster.SlideShowTransition.EntryEffect = ppEffectNone
    Next osld

    End Sub

  2. Have a great day.

  3. Tyas says:

    Is this also possible for a specific slide?

Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.

Plagiarism will be detected by Copyscape

© 2000-2025, Geetesh Bajaj - All rights reserved.

since November 02, 2000



-->