Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide line on a chart in PowerPoint using VBA

Status
Not open for further replies.

palladx

Programmer
Apr 14, 2009
3
PL
Hello all

I would like to hide some line on a chart via VBA.
Code I already have:


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub main()
Dim oshape As Shape
Dim shpGraph As Object
num_slides = ActivePresentation.Slides.Count

For x = 1 To num_slides
Set myDocument = Application.ActivePresentation.Slides(x)
myDocument.Select
num_shapes = ActiveWindow.Selection.SlideRange.Shapes.Count

For y = 1 To num_shapes
Set oshape = ActiveWindow.Selection.SlideRange.Shapes(y)

If oshape.Type = msoEmbeddedOLEObject Then
Set shpGraph = oshape.OLEFormat.Object

MsgBox shpGraph.SeriesCollection.Count

shpGraph.Application.Update
shpGraph.Application.Quit
End If
Next
Next
End Sub

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


To setup some attribute of the line i'm writing:
shpGraph.SeriesCollection(n). ... (attributes value)

where n is a number of the line with data, but i dont know what to write to hide the specific line.

If someone could help.

Thanks
Kris
 



Why not use one of the Action features to show the chart with and then without the series in question or vis versa.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 

That kind of charts, with some seriescollection hidden, I have to do via VBA a lot.
Besides it can be done using mouse with menu Graph so I assume that maybe it can be done via VBA.

Anyway thanks a lot for helping hand :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top