Forum

ForeColor.Brightnes...
 
Notifications
Clear all

ForeColor.Brightness

4 Posts
2 Users
0 Reactions
292 Views
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

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

 
Posted : 23/09/2018 4:59 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

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

 
Posted : 25/09/2018 12:45 am
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

I removed the line (as you suggested) and ran the code.  It worked!  

Thank you

 
Posted : 25/09/2018 1:46 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

You're welcome

 
Posted : 25/09/2018 1:56 am
Share: