Toggle glow effect of a shape

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Toggle glow effect of a shape

Post by ABabeNChrist »

I know how to toggle a shape from visible to not visible.

Code: Select all

    Dim shps As Shapes
    Dim shpRng As ShapeRange

    Set shps = ActiveSheet.Shapes
    Set shpRng = shps.Range(Array(1, 2))
    shpRng.Visible = Not shpRng.Visible
And I know how to change the color of a glow, but not sure how to toggle the glow effect of a shape visible / not visible ?

User avatar
HansV
Administrator
Posts: 78524
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Toggle glow effect of a shape

Post by HansV »

To turn glow off:

shpRng.Glow.Radius = 0

To turn it on:

Code: Select all

With shpRng.Glow
    .Radius = 20
    .Color = RGB(255, 224, 224)
End With
Radius can be between 0 and 20.
Color can be a symbolic constant such as vbGreen or any RGB color.
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Toggle glow effect of a shape

Post by ABabeNChrist »

I tried using a If then approach and I was able to get the glow to toggle to different colors, but still cannot get it to toggle Not Visible / Visible
Here is what I was able to do so far.

Code: Select all

    Dim shps As Shapes
    Dim shpRng As ShapeRange

    Set shps = ActiveSheet.Shapes
    Set shpRng = shps.Range(Array(1, 2))
    If shpRng.Glow.Color.RGB = RGB(0, 0, 0) Then
        shpRng.Glow.Color.RGB = RGB(250, 250, 250)
    Else
        shpRng.Glow.Color.RGB = RGB(0, 0, 0)
    End If

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Toggle glow effect of a shape

Post by ABabeNChrist »

I didn’t think of using the Radius.
I was trying hide it or change to back ground colour (which can be done) But I like the use of the radius much better
Thank you Hans
Also aren’t you up kind of early :grin:

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Toggle glow effect of a shape

Post by ABabeNChrist »

With your helpful suggestion I was able come up with this to toggle my glow
Thank you, it works great….

Code: Select all

    Dim shps As Shapes
    Dim shpRng As ShapeRange

    Set shps = ActiveSheet.Shapes
    Set shpRng = shps.Range(Array(1, 2))
    If shpRng.Glow.Radius = 1 Then
        shpRng.Glow.Radius = 11
    Else
        shpRng.Glow.Radius = 1
    End If

User avatar
HansV
Administrator
Posts: 78524
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Toggle glow effect of a shape

Post by HansV »

ABabeNChrist wrote:Also aren’t you up kind of early :grin:
Why? It's 7:45 AM here, I got up a bit before 7 AM.
Best wishes,
Hans

User avatar
Leif
Administrator
Posts: 7209
Joined: 15 Jan 2010, 22:52
Location: Middle of England

Re: Toggle glow effect of a shape

Post by Leif »

HansV wrote:Why? It's 7:45 AM here, I got up a bit before 7 AM.
Is 7:00am when your internal glow toggles? :grin:
Leif

User avatar
StuartR
Administrator
Posts: 12612
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Toggle glow effect of a shape

Post by StuartR »

Leif wrote:
HansV wrote:Why? It's 7:45 AM here, I got up a bit before 7 AM.
Is 7:00am when your internal glow toggles? :grin:
Mine certainly toggled off at about that time this morning.
StuartR


ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Toggle glow effect of a shape

Post by ABabeNChrist »

HansV wrote:Why? It's 7:45 AM here, I got up a bit before 7 AM.
You caught me off guard I don’t usually see you on Eileen’s Lounge during this time.
I just figured it was your battery charging time. I know I need at least 7 hours and 2 hot cups of java to get me going. My coffee got to resemble a mud like appearance, not colored water. It’s got to have a little kick to get my glow going. :coffeetime: