Consulting

Results 1 to 6 of 6

Thread: Automatic Slide Transition

  1. #1
    VBAX Newbie
    Joined
    Apr 2008
    Posts
    4
    Location

    Automatic Slide Transition

    I did a macro for a counter pointing to 1 slide om my presentation. Since the macro starts the slideshow and runs contisnously the Automatic Slide Trasition (set to 5 seconds on all slides) does not works.

    Any solution to this?

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Maybe if you post some code and explain a little more clearly what you need to achieve?
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Newbie
    Joined
    Apr 2008
    Posts
    4
    Location
    Here is the code

    [VBA]

    Option Explicit
    Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Sub Tmr()
    'Just in the eventuality that you click the start button twice
    'isRunning stores the current state of the macro
    'TRUE = Running; FALSE = Idle
    Static isRunning As Boolean
    If isRunning = True Then
    End
    Else
    isRunning = True
    Dim datEnd As Date
    Dim datNow As Date
    Dim sngDiff As Single
    Dim lngDays As Long
    Dim lngHours As Long
    Dim lngMinutes As Long
    Dim lngSeconds As Long



    datEnd = #4/15/2008 11:59:59 PM#
    datNow = Now

    'On Slide 1, Shape 1 is the textbox
    With ActivePresentation.Slides(1)
    With .Shapes(1)
    'Countdown in seconds
    Do While datNow < datEnd
    ' Suspend program execution for 1 second (1000 milliseconds)
    Sleep 1000
    sngDiff = datEnd - datNow
    lngDays = CLng(sngDiff)
    lngHours = Hour(sngDiff)
    lngMinutes = Minute(sngDiff)
    lngSeconds = Second(sngDiff)

    .TextFrame.TextRange.Text = lngDays & " Days " & lngHours & " hours " & lngMinutes & " minutes " & lngSeconds & " Seconds"
    datNow = Now
    ' Very crucial else the display won't refresh itself
    DoEvents
    Loop
    End With

    isRunning = False
    End

    End With
    End If
    End Sub
    [/VBA]

    What I want is slide 1 to transition automatically to slide 2 while the macro is still running. The the presentation will go back to slide 1 and slide 2 so on. Apparently the Automatic Transition of slide 1 after 5 seconds will not run until the macro is finish..

  4. #4
    VBAX Newbie
    Joined
    Apr 2008
    Posts
    4
    Location
    here is the presentation

  5. #5
    VBAX Newbie
    Joined
    Apr 2008
    Posts
    4
    Location

    Presetation

    HEre is the file

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    I'm guessing that you adapted the code from Shyam Pillai? You would do better to use SetTimer and KillTimer calls. Shyam explains how to use these here http://skp.mvps.org/ppt00021.htm (scroll down)

    SetTimer will call your procedure at set intervals leaving PowerPoint free to do other things in between.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •