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

on PowerPoint Presentation, Change the each Bar color of Excel Linked Graphs as per their value

Status
Not open for further replies.

brajcool

MIS
Jun 21, 2015
11
Hello Friends,

I'm new to this forum and this is my first post.

I need help of you guys to solve a headache.

Currently I'm working on a project which require to change the Bar colors as per values of Excel linked graphs.

The problem is when the values changed in Excel sheet, values change on PPT graph also but the color of Bar doesn't change.

There are several slides and on every slide there is only one graph. Please refer attached PowerPoint Presentation

I have found one code on your forum, however as I'm new to PowerPoint VBA, not able to convert as per my use, however make some changes though but I stuck where need to set Chart:

Sub atest()
Dim sl As Slide, sh As Shape, ch As Chart, s As Series

For Each sl In ActivePresentation.Slides
For Each sh In sl.Shape
If sh.Type = 3 Then
Set ch = sh.OLEFormat.Object 'here I stuck. Error Message "OLEFormat (unknown number) : Invalid Request. This property only applies to OLE Objects"
sh.Select
i = 1
For Each s In ch.SeriesCollection
Select Case i
Case 1
s.Interior.Color = RGB(0, 34, 76)
Case 2
s.Interior.Color = RGB(174, 188, 158)
Case 3
s.Interior.Color = RGB(111, 150, 201)
End Select
i = i + 1
Next
End If
Next
Next
End Sub

Please help as this is very urgent project and I am very much stuck into it.
 
 http://files.engineering.com/getfile.aspx?folder=d4185bc1-0a5a-423c-a0ec-d0fb73e7e0b6&file=CEB_Master_linked_v2.pptm
Thank you very much Skip.

Your code is really helpful and I am very thankful to your help.

Thanks a lot buddy!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top