Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Animating a Menu Bar
Hi. I want to animate a menu bar that is floating in Excel and flies in from
left to right. This is the code where I attemped to do it, but the screen isn't updated properly. How can I have a better visual look here. Thanks for helping. CODE SNIPPET: ------------------ Sub MENU_Makro3() Dim myBar As CommandBar Dim i As Integer ' Set myBar = CommandBars("My Menu") With myBar .Position = msoBarFloating .Top = 245 ' Wants to animate the menu bar flying in from Left For i = 35 To 600 .Left = i Next i End With ' Unfortuneately you can hardly se the Menu Bar moving. Why is that??? End Sub Regards Jan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Animating a Menu Bar
This is better:
Sub MENU_Makro3() Dim myBar As CommandBar Dim i As Integer Set myBar = CommandBars("My Menu") With myBar .Position = msoBarFloating .Top = 245 DoEvents For i = 35 To 600 .Left = i DoEvents Next i End With End Sub -- Jim "Jan G. Thorstensen" wrote in message ... Hi. I want to animate a menu bar that is floating in Excel and flies in from left to right. This is the code where I attemped to do it, but the screen isn't updated properly. How can I have a better visual look here. Thanks for helping. CODE SNIPPET: ------------------ Sub MENU_Makro3() Dim myBar As CommandBar Dim i As Integer ' Set myBar = CommandBars("My Menu") With myBar .Position = msoBarFloating .Top = 245 ' Wants to animate the menu bar flying in from Left For i = 35 To 600 .Left = i Next i End With ' Unfortuneately you can hardly se the Menu Bar moving. Why is that??? End Sub Regards Jan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Animating a Menu Bar
I think your menu is just not having enough time to redraw itself.
Play with the iPauseTime to adjust how fast the menu moves. I also added a Step in your For..Next statement that can adjust the speed of the animation. Sub MENU_Makro3() Dim myBar As CommandBar Dim i As Integer Dim iPauseTime Dim iStart iPauseTime = 0.01 Set myBar = CommandBars("My Menu") With myBar .Position = msoBarFloating .Top = 245 ' Wants to animate the menu bar flying in from Left For i = 35 To 600 Step 4 iStart = Timer Do While Timer < iStart + iPauseTime DoEvents ' Yield to other processes. Loop .Left = i Next i End With End Sub Regards Jan |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Animating a Menu Bar
Thanks a lot, Jim Rech. That did the trick!
Jan "Jim Rech" skrev i melding ... This is better: Sub MENU_Makro3() Dim myBar As CommandBar Dim i As Integer Set myBar = CommandBars("My Menu") With myBar .Position = msoBarFloating .Top = 245 DoEvents For i = 35 To 600 .Left = i DoEvents Next i End With End Sub -- Jim "Jan G. Thorstensen" wrote in message ... Hi. I want to animate a menu bar that is floating in Excel and flies in from left to right. This is the code where I attemped to do it, but the screen isn't updated properly. How can I have a better visual look here. Thanks for helping. CODE SNIPPET: ------------------ Sub MENU_Makro3() Dim myBar As CommandBar Dim i As Integer ' Set myBar = CommandBars("My Menu") With myBar .Position = msoBarFloating .Top = 245 ' Wants to animate the menu bar flying in from Left For i = 35 To 600 .Left = i Next i End With ' Unfortuneately you can hardly se the Menu Bar moving. Why is that??? End Sub Regards Jan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Drop dwn menu. Formula to count selection frm menu in anoth cell? | Excel Worksheet Functions | |||
Menu items added with menu item editor in older versions | Excel Discussion (Misc queries) | |||
Adding a menu item right click menu when clicking on a single. | Excel Programming | |||
Custom Menu return to Excel Menu upon Closing | Excel Programming | |||
Free animating ActiveX control | Excel Programming |