andrewb90
Well-known Member
- Joined
- Dec 16, 2009
- Messages
- 1,077
hello all:
I have this code:
In my test workbook, this works perfect, but in my actual workbook I want it in
timeout is highlighted and a compile error pops up. anybody have any idea why?
I have this code:
Code:
Sub grower() 'this centers object and gradually makes bigger
Dim myPicture As Shape
Set myPicture = ActiveSheet.Shapes("zax1")
With ActiveWindow.VisibleRange
myPicture.Top = .Top + .Height / 2 - myPicture.Height / 2
myPicture.Left = .Left + .Width / 2 - myPicture.Width / 2
End With
myPicture.Visible = True
rep_count = 0
Do
DoEvents
'MsgBox "HI"
ActiveSheet.Shapes("zax1").Height = ActiveSheet.Shapes("zax1").Height + 20
ActiveSheet.Shapes("zax1").Width = ActiveSheet.Shapes("zax1").Width + 20
'Sheet2.Shapes("zax1").Rotation = rep_count * 5
With ActiveWindow.VisibleRange
myPicture.Top = .Top + .Height / 2 - myPicture.Height / 2
myPicture.Left = .Left + .Width / 2 - myPicture.Width / 2
End With
myPicture.Visible = True
rep_count = rep_count + 1
timeout (0.22)
Loop Until rep_count = 10
End Sub
In my test workbook, this works perfect, but in my actual workbook I want it in
timeout is highlighted and a compile error pops up. anybody have any idea why?