Update Charts using VBA

L

Lizz45ie

I have some Powepoint charts that are linked to Excel that should update
after I select it but it's not working. There are four charts to a
slide. The first chart on the page flickers and briefly shows the
changes but reverts back to the old data. The three other charts on
the page does not update at all. In order to update them now I need to
double click each chart on each slide for the update to occur. My
sample code is attached below. Any help will be greatly appreciated.



Sub RefreshTest()
Dim slide As slide
Dim shape As shape
Dim Graph As Object

On Error Resume Next

For Each slide In Application.ActivePresentation.Slides
For Each shape In slide.shape
If shape.Type = msoEmbeddedOLEObject Then
If shape.OLEFormat.ProgID = "MSGraph.Chart.8" Then
Then Update
Set Graph = shape.OLEFormat.Object
Graph.Application.Update
End If
End If
Next shape
Next slide

End Sub
 

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