PDA

View Full Version : Chart Setsource



balumail75
07-06-2011, 05:18 AM
Hello all,

I created the following vba code for a chart in ppt to update data from excel sheet. the setsourcedata method is setting the link to the new data. Chart also updates in the PPT 2007.
But the chart data is not updated in the chart excel sheet. (when we right-click and select edit data)

Please help.

Sub updatenewdata()

Dim oSl As Slide
Dim oSh As Shape
Set oSl = ActivePresentation.Slides(1)

Set oSh = oSl.Shapes(1)

oSh.Chart.ChartData.Activate

oSh.Chart.SetSourceData ("='C:\Documents and Settings\sbalasubramanian\Desktop\CP Test\[channel panel Q4 2010 results (J. Wakstein 12-28-10).xls]networking'!$C$23:$C$31")

oSh.Chart.Refresh
oSh.Chart.ChartData.Workbook.Close


ActivePresentation.Save

Set oSl = Nothing
Set oSh = Nothing

End Sub


Thanks,

Regards,
Balu.