FracinDean
Board Regular
- Joined
- Jul 11, 2011
- Messages
- 110
- Office Version
- 365
- Platform
- Windows
I am attempting to use a macro to change the formatting of some shapes. I recorded some code with the macro recorder which works when I am recording it, but it doesn't work when I re-run it from the macro. Here is the code:
The error is "Run-time error '438': Object doesn't support this property or method."
The debugger is pointing to the statement "With Selection.ShapeRange.Fill"
This seems to be my last hurdle on this project. Thanks to past postings from this forum, I have learned tonight about how to delete the previous objects, use user-defined coordinates to draw the objects, and re-name the two objects so they are always #1 and #2.
Any assistance appreciated.
Code:
ActiveChart.ChartArea.Select
ActiveChart.Shapes.Range(Array("Freeform 1")).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorBackground1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = -0.150000006
.Transparency = 0
.Solid
End With
The error is "Run-time error '438': Object doesn't support this property or method."
The debugger is pointing to the statement "With Selection.ShapeRange.Fill"
This seems to be my last hurdle on this project. Thanks to past postings from this forum, I have learned tonight about how to delete the previous objects, use user-defined coordinates to draw the objects, and re-name the two objects so they are always #1 and #2.
Any assistance appreciated.