G
Guest
In PP 97 I used the UpdateAllGraphs VB routine to automatically update the
(set to manual) paste links and the embedded (graph 8) links in about 50
PPT's each month.
I just upgraded to XP, redesigned the PP's and now, only the paste links
update. Here is the code I am using. Can anyone tell me why it no longer
works? I tried the mvps add-in and it changed all my charts!
Thanks, Mike
Sub UpdateAllGraphs()
Dim shapeObject As Shape
Dim lSlideCount As Long
Dim lCount As Long
Dim oGraph As Object
Dim bLaunch As Boolean
'Update the Excel Objects first
For Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
If sh.Type = msoLinkedOLEObject Then
sh.LinkFormat.Update
End If
Next
Next
'initialize counter
lCount = 0
'Get the number of slides in the presentation
lSlideCount = ActivePresentation.Slides.Count
'Loop through each slide
For lCount = 1 To lSlideCount
'look at all the shapes on the current slide
For Each shapeObject In ActivePresentation.Slides(lCount).Shapes
'Is this a OLE object
If shapeObject.Type = msoEmbeddedOLEObject Then
'if it is an OLE object, then is it a Graph 8 (I changed
this to 10) object
If shapeObject.OLEFormat.progID = "MSGraph.Chart.10" Then
'found a graph...update it
Set oGraph = shapeObject.OLEFormat.Object
oGraph.Application.Update
bLaunch = True
End If
End If
Next shapeObject
Next lCount
If bLaunch Then
oGraph.Application.Quit
Set oGraph = Nothing
End If
End Sub
(set to manual) paste links and the embedded (graph 8) links in about 50
PPT's each month.
I just upgraded to XP, redesigned the PP's and now, only the paste links
update. Here is the code I am using. Can anyone tell me why it no longer
works? I tried the mvps add-in and it changed all my charts!
Thanks, Mike
Sub UpdateAllGraphs()
Dim shapeObject As Shape
Dim lSlideCount As Long
Dim lCount As Long
Dim oGraph As Object
Dim bLaunch As Boolean
'Update the Excel Objects first
For Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
If sh.Type = msoLinkedOLEObject Then
sh.LinkFormat.Update
End If
Next
Next
'initialize counter
lCount = 0
'Get the number of slides in the presentation
lSlideCount = ActivePresentation.Slides.Count
'Loop through each slide
For lCount = 1 To lSlideCount
'look at all the shapes on the current slide
For Each shapeObject In ActivePresentation.Slides(lCount).Shapes
'Is this a OLE object
If shapeObject.Type = msoEmbeddedOLEObject Then
'if it is an OLE object, then is it a Graph 8 (I changed
this to 10) object
If shapeObject.OLEFormat.progID = "MSGraph.Chart.10" Then
'found a graph...update it
Set oGraph = shapeObject.OLEFormat.Object
oGraph.Application.Update
bLaunch = True
End If
End If
Next shapeObject
Next lCount
If bLaunch Then
oGraph.Application.Quit
Set oGraph = Nothing
End If
End Sub