change scale (among other things) across multiple graphs

T

TomCrumlish

We use an outside program that builds charts directly in PowerPoint 2003. It
generally does a nice job, but there are a few items that I need to change on
every chart. For example, I need to set the scale to 100% (currently they
are built with varying scales ranging from 0 to 120%). I also need to do
what is essentially a find and replace where I need any text that reads
z?????z to be replaced with nothing (where the ? marks represent text and
there may be a different number of letters between the z's in each graph).
Are either or both of these possible? And if so, how?
 
J

John Wilson

Not sure I know what you mean by scale but the replace should be possible
with vba code

If you don't know how to use this see: http://www.pptalchemy.co.uk/vba.html


'The Code
Sub mygraphs()
Dim osld As Slide
Dim oshp As Shape
Dim ograph As Object
Dim Icol As Integer
Dim Irow As Integer

For Each osld In ActivePresentation.Slides
'Find the msGraph object
For Each oshp In osld.Shapes
If oshp.Type = msoEmbeddedOLEObject Then
If oshp.OLEFormat.ProgID Like "MSGraph*" Then
'it's a graph
Set ograph = oshp.OLEFormat.Object
'do something with it
Irow = 1
Icol = 2 ' avoids blank cell at 1,1

Do While ograph.Application.DataSheet.Cells(Irow, Icol) <> ""
Do While ograph.Application.DataSheet.Cells(Irow, Icol) <> ""
If ograph.Application.DataSheet.Cells(Irow, Icol) Like "x*x" Then _
ograph.Application.DataSheet.Cells(Irow, Icol) = ""
Icol = Icol + 1
Loop
Icol = 1
Irow = Irow + 1
Loop
End If 'it's an OLE object
End If 'it's a graph
Next oshp
Next osld
End Sub
'end

--
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
PPTLive Atlanta Oct 11-14 2009
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top