Class ChartData (PowerPoint VBA)

The class ChartData represents access to the linked or embedded data associated with a chart. To use a ChartData class variable it first needs to be instantiated, for example


Dim cda as ChartData
Set cda = ActiveWindow.RangeFromPoint.Chart.ChartData

Activate

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

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).


ActivePresentation.Slides(1).Shapes(1).Chart.ChartData.Activate

ActivateChartDataWindow

Opens a Excel data grid window that contains the full source data for the specified chart.

If the data grid window is already open, this method has no effect. The ActivateChartDataWindow method differs from the ChartData.Activate method in that the former opens the chart in an Excel window within Word, with the Excel ribbon unavailable, whereas the latter opens a full version of Excel, with the ribbon available.


ActiveWindow.RangeFromPoint.Chart.ChartData.ActivateChartDataWindow

Removes the link between the data for a chart and a Microsoft Excel workbook.

Calling this method sets the IsLinked property of the ChartData object to False.


ActivePresentation.Slides(1).Shapes(1).Chart.ChartData.BreakLink

IsLinked

True if the data for the chart is linked to an external Microsoft Excel workbook.

Using the BreakLink method to remove the link to an Excel workbook sets this property to False.


Dim booIsLinked As Boolean
booIsLinked = ActivePresentation.Slides(1).Shapes(1).Chart.ChartData.IsLinked

Workbook

Returns the workbook that contains the chart data associated with the chart.


Dim wbWorkbook As Workbook
wbWorkbook = ActivePresentation.Slides(1).Shapes(1).Chart.ChartData.Workbook