Thread: animation
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default animation

1. For making it slow use a timer in betwen the For loop. Adjust the seconds
as needed
Application.Wait Now + TimeValue("00:00:05")

2. If you want this to happen during open write the code in Workbook_Open()
event

If this post helps click Yes
---------------
Jacob Skaria


"MAX" wrote:

I have an animated excel file with a picture rolling from left to right of
the screen. The is done when I click on the picture. My first problem is that
the picture rolls very fast and I want to reduce its speed, and the second
problem is that I want this animation not when I click on the picture but
when I open the file. I am using Excel 2007 and below is the code that I am
using. Any help.

Thanks.

Code:

Sub StartDemo1()
On Error Resume Next
Set OldCell = ActiveCell
ActiveSheet.Shapes("Picture 1").Select
For i = 0 To 360 Step 3
Selection.ShapeRange.IncrementRotation 15
Selection.ShapeRange.Left = Selection.ShapeRange.Left + 10
Selection.ShapeRange.Top = Selection.ShapeRange.Top - 0.1
DoEvents
Next i

For i = 360 To 0 Step -6
Selection.ShapeRange.IncrementRotation -15
Selection.ShapeRange.Left = Selection.ShapeRange.Left - 20
Selection.ShapeRange.Top = Selection.ShapeRange.Top + 0.1
DoEvents
Next i
Selection.ShapeRange.Top = 300
Selection.ShapeRange.Left = 42
OldCell.Select
End Sub