Table of contents
TOC
Collapse the table of content
Expand the table of content

ChartData.Activate Method (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

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

Syntax

expression. Activate

expression A variable that represents a ChartData object.

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 method to run those macros).

Note You must call this method before referencing the Workbook property.

Example

Note Although the following code applies to Microsoft Word, you can readily modify it to apply to PowerPoint.

The following example activates the 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 ActiveDocument.InlineShapes(1) 
    If .HasChart Then 
        .Chart.ChartData.Activate 
        .Chart.ChartData.Workbook. _ 
            Worksheets("Sheet1").Range("B1:B5").Copy 
        .Chart.Paste 
    End If 
End With 

See also

Concepts

ChartData Object

© 2018 Microsoft