Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I animate the borders in Excel? turtlerita Excel Discussion (Misc queries) 4 October 4th 07 04:20 PM
animate text in Excel? Andy Pham Excel Discussion (Misc queries) 3 February 28th 06 08:50 PM
Animate excel? BAM718 Excel Worksheet Functions 1 March 29th 05 04:44 PM
how do you animate a cell atbs Excel Discussion (Misc queries) 0 March 14th 05 03:25 AM
How do I get gif files to animate in Excel? Ray Stubblefield Excel Discussion (Misc queries) 1 January 11th 05 04:38 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"