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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PowerPoint Graph Editing

Status
Not open for further replies.

GoldVerge

MIS
Joined
Jul 6, 2007
Messages
1
Location
US
Hi!

I'm simply trying to insert a single row into every chart of a PowerPoint slide. There can be 3-12 charts a slide and there are 100+ slides (which is why I'm not doing this by hand). All I want is to insert a new row in between two others, specifically between Rows 3 and 4 in every chart.

I can't seem to figure it out. This is what I have so far in a PowerPoint VBA macro...


For Each Slide1 In ActivePresentation.Slides
For i = 1 To Slide1.Shapes.Count
If Slide1.Shapes(i).Type = msoEmbeddedOLEObject Then
Set Shape1 = Slide1.Shapes(i)
If Shape1.OLEFormat.ProgID = "MSGraph.Chart.8" Then
Set Graph1 = Shape1.OLEFormat.Object
Graph1.Application.DataSheet.Range(3, 1).Insert
End If
End If
Next
Next


The part I bolded is what I THOUGHT would work, but gives me a Run Time Error 1004: Application-defined or object defined error.

It's probably simply the wrong command, but I've been searching around for a while and I can't figure it out.

Any help would be greatly appreciated!

Thanks!
Mike
 




Hi,

Put a break in your code at the Set Graph1 statement.

Do a Watch Window on Graph1.Application.DataSheet faq707-4594 and drill down to discover what you are looking for.



Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top