Hi members.
I try to rotate a shape with this bit of vba thus creating an animation.
Code is in Module
code hangs at Sleep 20. I know that excel can run into unlimited loop when using unappropriate code. However this freezes during stepping through the code.
Anyone ?
Thanks
I try to rotate a shape with this bit of vba thus creating an animation.
Code is in Module
Code:
Public Declare Function Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub rectanim()
Dim wb1 As Workbook
Dim ws1 As Worksheet
Set wb1 = Workbooks("anim.xlsm")
Set ws1 = wb1.Worksheets("Sheet1")
Dim d As Shape
Set d = ws1.Shapes("Rec1")
d.Fill.ForeColor.RGB = RGB(0, 0, 0)
d.Select
For i = 0 To 359
DoEvents
Sleep 20
d.Rotation = i
Next i
End Sub
code hangs at Sleep 20. I know that excel can run into unlimited loop when using unappropriate code. However this freezes during stepping through the code.
Anyone ?
Thanks