Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
animate autoshapes
Is it possible to animate an object when a workbook
opens. I would like to create an autoshape (an arrow) and when the workbook is opened, I would like to have the arrow flash on and off or change colors, etc. Something to grab the users attention. Is this possible? Any help with the code would be appreciated. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
animate autoshapes
Here are two subs - one that flashes a shape, the other cycles the fill
color. For the "Set MyShape = " use the name of the autoshape as it appears in the Name Box on the Excel toolbar when you have it selected. You can adjust the number of cycles as needed, or the other particulars. I have set the color cycle to random colors, but you could use a predefined set if you modify the code. To run when opening the book, set one of these to be your Workbook_Open event procedu Public Sub FlashShape() Dim MyShape As Object, EndTime As Date, Cycle As Integer Set MyShape = Sheets("Sheet1").Shapes("Autoshape 1") For Cycle = 1 To 5 MyShape.Visible = False EndTime = Timer + 0.2 While EndTime Timer DoEvents Wend MyShape.Visible = True EndTime = Timer + 0.2 While EndTime Timer DoEvents Wend Next Cycle End Sub Public Sub ColorCycle() Dim MyShape As Object, EndTime As Date, Cycle As Integer Dim RVal As Integer, GVal As Integer, BVal As Integer Set MyShape = Sheets("Sheet1").Shapes("Autoshape 1") Randomize For Cycle = 1 To 5 RVal = Int(Rnd * 256) GVal = Int(Rnd * 256) BVal = Int(Rnd * 256) MyShape.Fill.ForeColor.RGB = RGB(RVal, GVal, BVal) EndTime = Timer + 0.5 While EndTime Timer DoEvents Wend Next Cycle End Sub "JT" wrote: Is it possible to animate an object when a workbook opens. I would like to create an autoshape (an arrow) and when the workbook is opened, I would like to have the arrow flash on and off or change colors, etc. Something to grab the users attention. Is this possible? Any help with the code would be appreciated. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I animate the borders in Excel? | Excel Discussion (Misc queries) | |||
animate text in Excel? | Excel Discussion (Misc queries) | |||
Animate excel? | Excel Worksheet Functions | |||
how do you animate a cell | Excel Discussion (Misc queries) | |||
How do I get gif files to animate in Excel? | Excel Discussion (Misc queries) |