Visio Update Screen

R

RobC

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
 
C

Chris Roth [ Visio MVP ]

Try putting a DoEvents in there between animation steps?

--

Hope this helps,

Chris Roth
Visio MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top