Name

chartfillformat.Solid( )

Synopsis

Applies a solid color, removing any patterns, textures, or gradients. The following code resets the chart area to solid white:

Sub ResetFill( )
    Dim chrt As Chart, cf As ChartFillFormat
    ' Get the chart.
    Set chrt = ActiveChart
    ' Get the chart area fill.
    Set cf = chrt.ChartArea.Fill
    ' Make the fill visible.
    cf.Visible = True
    ' Display a solid color.
    cf.Solid
    ' Set the color to white
    cf.ForeColor.SchemeColor = 2
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.