How do I exclude rows in a charts dataset in vba?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some vba in powerpoint which populates a datasheet within a slide. I
only want some of the rows of this datasheet to appear in the chart.

If I double click the rows to exclude them before populating the sheet they
just reappear once the sheet is populated. I'm trying to find the code to
exclude the rows after I've populated.
 
Ross,

Here is sample code which excludes the 1st row of the chart data. I've
assumed that 1st shape on the 1st slide of the active presentation is a
MSGraph object.
' =========================================================
Dim oChart As Graph.Chart
Dim oDataSheet As Graph.DataSheet
Set oChart = ActivePresentation.Slides(1).Shapes(1).OLEFormat.Object
Set oDataSheet = oChart.Application.DataSheet

oDataSheet.Rows(1).Include = False

oChart.Application.Update
oChart.Application.Quit
Set oDataSheet = Nothing
Set oChart = Nothing
' =========================================================
 
Back
Top