hindersaliva
asked on
Excel 2013 Shapes Color mystery
What I'm trying to do is
but I get a Type Mismatch error.
Can someone please explain why I'm getting this? I see that the ForeColor is a long integer but I get a Type Mismatch error. So I tried String data type and get the same error.
ActiveSheet.Shapes("shpPart1").Fill.ForeColor = 13998939
but I get a Type Mismatch error.
Can someone please explain why I'm getting this? I see that the ForeColor is a long integer but I get a Type Mismatch error. So I tried String data type and get the same error.
Sub PartShapesTEST2()
Dim s As Shape
Dim lngColor As Long
Set s = ActiveSheet.Shapes("shpPart1")
lngColor = s.Fill.ForeColor
s.Fill.ForeColor = lngColor
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Should be
s.Fill.ForeColor.RGB = lngColor
even though the color is not in RGB ie. not as in (255, 0, 0)