Skip to content

Latest commit

 

History

History
71 lines (38 loc) · 1.54 KB

PowerPoint.ChartData.Workbook.md

File metadata and controls

71 lines (38 loc) · 1.54 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ChartData.Workbook property (PowerPoint)
vbapp10.chm689001
vbapp10.chm689001
PowerPoint.ChartData.Workbook
2d22aa4a-15d8-c5f3-5059-a968e9a85789
06/08/2017
medium

ChartData.Workbook property (PowerPoint)

Returns the workbook that contains the chart data associated with the chart. Read-only Object.

Syntax

expression.Workbook

expression A variable that represents a 'ChartData' object.

Remarks

Note

You must call the Activate method before referencing this property; otherwise, an error occurs.

Example

Note

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

The following 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.

Note

Excel must be open to modify data in the workbook.

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

ChartData Object

[!includeSupport and feedback]