Share via


ChartData.Activate Method

Activates the first window of the workbook associated with the chart.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Sub Activate
'Usage
Dim instance As ChartData

instance.Activate()
void Activate()

Remarks

If the chart is linked to a Microsoft Excel workbook, this method does not run any Auto_Activate or Auto_Deactivate macros that might be attached to the workbook (use the [RunAutoMacros#DifferentCHM] method to run those macros).

Note

This method must be called before referencing the Workbook property.

Examples

This example activates the Microsoft Excel workbook associated with the first chart in the active document. If the Excel workbook has multiple windows, the example activates the first window. The example then copies the contents of cells B1 through B5 and pastes the cell contents into the chart.

With ActivePresentation.Slides(1).Shapes(1)

    If .HasChart Then

        .Chart.ChartData.Activate.Chart.ChartData.Workbook. _

            Worksheets("Sheet1").Range("B1:B5").Copy

        .Chart.Paste

    End If

End With

See Also

Reference

ChartData Interface

ChartData Members

Microsoft.Office.Interop.PowerPoint Namespace