I am working in an older version of Microsoft Excel (2007).
There is an issue with my macro, it stops when it reaches .ForeColor.Brightness = 0.
But if I use the macro in a new Microsoft Excel version it works. Can you help?
Sub addshape (r As Integer, c1 As Integer, c2 As Integer, c3 As Integer)
Dim shp As Shape
With ActiveSheet.Cells (r, c3)
Set shp = ActiveSheet.Shapes.addshape(msoShapeOval, .Left +1, .Top +1, .Width - 2, .Height - 2)
shp.Fill.Visible = msoFalse
With shp.Line
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorText1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
End With
End With
End Sub
Hi,
Was this originally created using the macro recorder?
I ask because I've read that the VBA recorder will include a setting for Brightness, but when you try to run the macro, it will sometimes fail.
I ran this in Excel 2013 and had no issue though. I think Brightness isn't supported in Excel 2007.
What is your desired result? Do you actually need to set the Brightness? Have you tried removing this line and running the code?
Phil
I removed the line (as you suggested) and ran the code. It worked!
Thank you
You're welcome