With Worksheets("1").ChartObjects("aca")
With Parent.Shape.Range(Array("dl"))
.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0.6200000048
.Solid
End With
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 192, 0)
.Transparency = 0.6200000048
.Solid
End With
End With
但没有运气
答案 0 :(得分:0)
试试这个:
With Worksheets("1").ChartObjects("aca").Chart.Shapes.Range(Array("dl"))
.Visible = True
End With
答案 1 :(得分:0)
ddLeft = dlLeft
ddWidth = (xAxis.MaximumScale) / (xAxis.MaximumScale - xAxis.MinimumScale) * xAxis.Width + yaxis.MajorUnit * 2
ddHeight = (yaxis.MaximumScale / 2) / (yaxis.MaximumScale + yaxis.MinimumScale) * yaxis.Height
ddTop = yaxis.Top
' draw the rectangle
Set rect = cht.Rectangles.Add(ddLeft, ddTop, ddWidth, ddHeight)
With rect
.Name = "gl"
End With
With rect.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0.2
.Transparency = 0.7
.Solid
.ForeColor.RGB = RGB(255, 0, 0)
End With
With rect.ShapeRange.Line
.Visible = msoFalse
End With