Background Property

Microsoft Excel Visual Basic

Returns a Shape object that represents the background image for the specified document. Read-only.

expression.Background

expression    Required. An expression that returns a CanvasShapes object.

ShowBackground property as it applies to the Font object.

Returns or sets the text background type. This property is used for text on charts. Read/write Variant.

expression.Background

expression    Required. An expression that returns a Font object.

Remarks

The following constants can be used with the Background property as it applies to the Font object: xlBackgroundAutomatic, xlBackgroundOpaque, xlBackgroundTransparent.

Example

This example adds a chart title to embedded chart one on the first worksheet and then sets the font size and background type for the title. This example assumes a chart exists on the first worksheet.

Sub UseBackground()

    With Worksheets(1).ChartObjects(1).Chart
        .HasTitle = True
        .ChartTitle.Text = "Rainfall Totals by Month"
        With .ChartTitle.Font
            .Size = 10
            .Background = xlBackgroundTransparent
        End With
    End With

End Sub