This documentation is archived and is not being maintained.

Workbook.ActiveChart Property

Gets a Microsoft.Office.Interop.Excel.Chart object that represents the active chart (either an embedded chart or a chart sheet). An embedded chart is considered active when it is either selected or activated. When no chart is active, this property returns a null reference (Nothing in Visual Basic).

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in microsoft.office.tools.excel.dll)

public virtual Chart ActiveChart { get; }

Property Value

A Microsoft.Office.Interop.Excel.Chart object that represents the active chart; a null reference (Nothing in Visual Basic) if no chart is active.

The following code example uses the ActiveChart property to get the active chart for the current workbook and then makes the title of the chart invisible.

private void HideActiveChartTitle()
{
    if (this.ActiveChart != null)
    {
        this.ActiveChart.HasTitle = false;
    }
}

Show: