Visio Update Screen

Visio Update Screen

Post by RobC » Sun, 24 Apr 2005 06:38:11


Hi,

I just upgraded to Visio 2003 from 2002 and I cannot show movement in my
drawings as I did in 2002. I have a drawing and I was animating
movement with the following code. In Visio 2002, I used the
(winObj.Select shpObj, visDeselect) command to force the screen to
update while in the loop which showed nice smooth movement, however in
2003 it no longer works. It just shows the final movement / placement
after the routine in complete. I tried (Application.ScreenUpdating =
True) to no avail and (ShowChanges = True) but always Method not
Supported but my understanding is that is always true unles set to
false.

Any help would be appreciated... Thanks, Rob

Private Sub CommandButton1_Click()
'On Error Resume Next
If WheelsUp = False Then
Dim i As Long
Dim ang As Integer
ang = 0
Set winObj = Visio.ActiveWindow
Set shpsObj = ThisDocument.Pages.Item("FullSide").Shapes

Set shpObj = shpsObj.Item("Sheet.40")
Set celObj = shpObj.Cells("Angle")
ang = 0
Do While ang >= -40
celObj.Formula = ang & "deg"
Application.ScreenUpdating = True
Call Sleep(10)
winObj.Select shpObj, visDeselect
celObj.Formula = ang & "deg"
ang = ang - 1
Loop

Set shpObj = shpsObj.Item("Sheet.3")
Set celObj = shpObj.Cells("Angle")
ang = 0
Do While ang >= -25
celObj.Formula = ang & "deg"
Application.ScreenUpdating = True
Call Sleep(10)
winObj.Select shpObj, visDeselect
celObj.Formula = ang & "deg"
ang = ang - 1
Loop
Call Sleep(300)
Set shpObj = shpsObj.Item("Sheet.85")
Set celObj = shpObj.Cells("Angle")
ang = 0
Do While ang <= 40
celObj.Formula = ang & "deg"
Application.ScreenUpdating = True
Call Sleep(10)
winObj.Select shpObj, visDeselect
celObj.Formula = ang & "deg"
ang = ang + 1
Loop

Set shpObj = shpsObj.Item("Sheet.21")
Set celObj = shpObj.Cells("Angle")
ang = 0
Do While ang <= 25
celObj.Formula = ang & "deg"
Application.ScreenUpdating = True
Call Sleep(10)
winObj.Select shpObj, visDeselect
celObj.Formula = ang & "deg"
ang = ang + 1
Loop
WheelsUp = True
End If

End Sub
 
 
 

Visio Update Screen

Post by Chris Roth » Mon, 25 Apr 2005 07:16:57

Try putting a DoEvents in there between animation steps?

--

Hope this helps,

Chris Roth
Visio MVP

 
 
 

Visio Update Screen

Post by RobC » Tue, 26 Apr 2005 23:38:44

Chris, Perfect... Thank you very much. Rob


"Chris Roth [ Visio MVP ]" < XXXX@XXXXX.COM > wrote in