PowerPoint - Run Time
PowerPoint tips, hints and tutorials that will change your presentations for ever!



Custom Shows
vba code
Games for teachers
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Set spellcheck language

Home buttonTutorial buttonContact buttonProducts button

PowerPoint Running Time

If you have an auto running PowerPoint presentation then you might want to estimate how long it will run for. You could of course just time it but this will take some time!

If you have a very simple presentation with no animation then you can use vba code to add up the slide transition times. Usually though you will have animations to factor in and this can get quite complicated. The code below is for versions that use the timeline (XP onwards)

You will need to account for delays, with and after previous animations and also whether the animations take longer than the slide transition delay.

Here's some code that tries to do that! It won't factor in videos and music though.

Don't know how to use code?

Sub howlongisit()
Dim sSlideTime As Single
Dim sCurr As Single
Dim sLast As Single
Dim sSpeed As Single
Dim sTranDelay As Single
Dim sRunningTot As Single
Dim runTime As Date
Dim strResult As String
Dim osld As Slide
Dim oeff As Effect
Dim i As Integer

'Does not account for sound, video or delays
For Each osld In ActivePresentation.Slides
For i = 1 To osld.TimeLine.MainSequence.Count
Set oeff = osld.TimeLine.MainSequence(i)
sCurr = oeff.Timing.Duration + oeff.Timing.TriggerDelayTime
Select Case oeff.Timing.TriggerType
Case Is = 1, 2
If sCurr > sLast Then
sSlideTime = sSlideTime + (sCurr - sLast)
sLast = sCurr
End If
Case Is = 3
sSlideTime = sSlideTime + sCurr
sLast = sCurr
End Select
Next i
sTranDelay = osld.SlideShowTransition.AdvanceTime
If sSlideTime > sTranDelay Then

strResult = strResult & "Slide " & osld.SlideIndex & " runs for " & Round(sSlideTime) & " seconds" & vbCrLf
sRunningTot = sRunningTot + sSlideTime
strResult = strResult & "Slide " & osld.SlideIndex & " runs for " & Round(sTranDelay) & " seconds" & vbCrLf
sRunningTot = sRunningTot + sTranDelay
End If
sSlideTime = 0
sLast = 0
Next osld

MsgBox strResult & vbCrLf & "Running time = " & Int(sRunningTot \ 60) & " Minutes " _
& Round(sRunningTot - (sRunningTot \ 60)) & " Seconds"

End Sub


Not guaranteed to be accurate to the second but should be close!







Back to the Index Page


Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation