Please Heeeeelp! Vba code to add animation to an existing object

  • Thread starter Thread starter lizsantiago
  • Start date Start date
That was one second per iteration. I figured I would rotate around 10+
times at 1 degree increments so that is between 3600 and 3960
iterations. At about 1/100th of a second per iteration that would mean
that a spin would take 3 or 4 seconds. As it turned out at 1 second, it
would take over an hour.
--David

As in "One second for the whole rotation to occur" or "One second per
iteration of the loop"? (I have to confess, the first time through I plugged
in a way big number for Sleep, forgetting that it might come up randomly with
a really large number of iterations. Task Manager is your Friend.)


I tried Sleep , and


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Unfortunately, I don't think that this code mixes with my code. My code
doesn't use animations. It just rotates the object. The code you put
here is for real animations. With real animations, you have more control
over the way it looks, but you have no way of knowing where the spinner
ends up.

One way to make it go a bit faster is to have the increment of the
rotation be 2 (or 3) degrees instead of 1.

--David

David, thanks let me tell you that your code works is a pity i cant make it go faster. Do you think this could be mix wioth your code to make it faster
Returns or sets a Single that represents the speed, in seconds, of the specified animation. Read/write.
Syntax

expression.Speed

expression A variable that represents a Timing object.

Example


This example sets the animation for the main sequence to reverse and sets the speed to one second.

Visual Basic for Applications
Sub AnimPoints()
Dim tmlAnim As TimeLine
Dim spdAnim As Timing

Set tmlAnim = ActivePresentation.Slides(1).TimeLine
Set spdAnim = tlnAnim.MainSequence(1).Timing
With spdAnim
.AutoReverse = msoTrue
.Speed = 1
End With
End Sub


Steve, i couldn't make your code work but thanks for all your replies.


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
I finally found something that makes the effect i was looking and i wanted to posted here just in case anyone else might need it.
Sub RndSpin(oShp as Shape)
Dim t As Single
t = Timer + (Rnd * 4) + 1
Do Until Timer > t
oShp.Rotation = oShp.Rotation + 5
DoEvents
Loop
End Sub
thanks everyone for your help!!!!;>
 
I finally found something that makes the effect i was looking and i wanted to posted here just in case anyone else might need it.
Sub RndSpin(oShp as Shape)
Dim t As Single
t = Timer + (Rnd * 4) + 1
Do Until Timer> t
oShp.Rotation = oShp.Rotation + 5
DoEvents
Loop
End Sub
thanks everyone for your help!!!!;>

That's great. It limits the time of rotation instead of the number of
rotations. However, it is mostly the same idea as what we did. I'm
surprised that the screen refreshes to show the rotation. But if it
works, I'm not going to argue with it.
--David

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Back
Top