Consulting

Results 1 to 5 of 5

Thread: Update Links in PPT 2007

  1. #1

    Update Links in PPT 2007

    Hi,

    I was using this code to update my Excel object links in a PPT 2003 file. It doesn't seem to work with the 2007 file. What do I need to change?

    [VBA]Function RefreshPPT()
    Dim PPT As Object
    Set PPT = CreateObject("PowerPoint.Application")
    PPT.Visible = True
    PPT.Presentations.Open "myfilepath.pptm"
    PPT.ActivePresentation.UpdateLinks
    PPT.ActivePresentation.Save
    PPT.Quit
    Set PPT = Nothing
    End Function[/VBA]

  2. #2
    Well, I discovered this code does work, provided I have all the links set to automatic update. The problem is, when the links are set to automatic update, the "Update Links" Security Notice pops up whenever the file is opened. Can anyone tell me if I can respond to this pop-up through VBA? Bottom line is that I am trying to open the file, update the links, then close the file programmatically.

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Maybe something like this (with manual links)
    [vba]Sub Relink()
    Dim i As Integer
    Dim s As Integer
    Dim PPT As Object
    Set PPT = CreateObject("PowerPoint.Application")
    PPT.Visible = True
    PPT.Presentations.Open "myfilepath.pptm"
    For i = 1 To PPT.ActivePresentation.Slides.Count
    For s = 1 To PPT.ActivePresentation.Slides(i).Shapes.Count
    If PPT.ActivePresentation.Slides(i).Shapes(s).Type = msoLinkedOLEObject Then
    PPT.ActivePresentation.Slides(i).Shapes(s).LinkFormat.Update
    End If
    Next s
    Next i
    PPT.ActivePresentation.Save
    PPT.Quit
    End Sub[/vba]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  4. #4
    Thanks John. I'll give that a try. In the meantime I stumbled on another solution.

    I found if I leave the presentation in Auto Update mode I can open the file as an "untitled" file and it doesn't give me the Security Notice pop-up. I can then use the UpdateLinks command and SaveAs the orginal file. This works great!

    PPT.Presentations.Open "myfilepath.pptm", Untitled:=msoTrue
    PPT.ActivePresentation.UpdateLinks
    PPT.ActivePresentation.SaveAs "myfilepath.pptm"

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    good find!
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •