VBA Error

gmatriix

Registered User.
Local time
Today, 11:53
Joined
Mar 19, 2007
Messages
365
Hello All,

I have this code that keeps error out. I tried it a number of ways and I still get errors. This is in powerpoint by the way. All I am trying to do is update the link in the Graph.

Code:
Private Sub CommandButton1_Click()
    Dim osld As Slide
    Dim oshp As Shape
    For Each osld In ActivePresentation.Slides
        For Each oshp In osld.Shapes
            If oshp.Type = msoLinkedOLEObject Then
                oshp.LinkFormat.Update
             Next oshp
        Next osld
    End Sub

Any Ideas?

Thanks
End Sub
 
It would help to know what line it errors on.

I don't know much about VBA in PPT but I'm sure it may help someone else who has worked with PPT more.
 
It is saying...Compile Error "Next" without a "For"
 
Code:
For Each osld In ActivePresentation.Slides
    For Each oshp In osld.Shapes
        If oshp.Type = msoLinkedOLEObject Then
            oshp.LinkFormat.Update
        [b]End If[/b]
    Next oshp
Next osld
 
Thanks Alot ....however it still not working....All I have is a graph linked to a excel spreadsheet...does anyone know what could be wrong with this code?????????

any ideas??

Thanks
 
Last edited:

Users who are viewing this thread

Back
Top Bottom