Ok, I read about the VBA code that can be used to ask the user (me) to
choose a new link source. Of course, every answer creates 3 new
questions. So...
1) Where in PP do insert this code?
See:
How do I USE this VBA stuff in PowerPoint?
http://www.rdpslides.com/pptfaq/FAQ00033.htm
2) What triggers the code being run?
That can happen in several ways. For starters, add the code to a copy of the
presentation you're working with as described in the link above. Then select
the linked object and press Alt+F8 or choose Tools, Macros, Macros then select
and run EditLink.
3) Having once been a systems programmer it looks to me like this code
does not allow me to point to specific object such as a chart within a
spreadsheet. Instead, the code looks like it lets me simply choose a
file (it returns the path to the file). But this is exactly what the
"Change Source" feature in the "Edit Links" dialog does.
It does allow you to point to a specific object, but there are indeed a couple
problems with it if you're using it to edit links to specific spreadsheet
ranges. This version works for that. Watch for linebreaks ( or revisit the
same link as before - I've updated it with this code):
Sub EditLink()
Dim sLinkSource As String
Dim sOriginalLinkSource As String
If ActiveWindow.Selection.ShapeRange.Count <> 1 Then
MsgBox ("Please select one and only one shape, then try again.")
Exit Sub
End If
With ActiveWindow.Selection.ShapeRange(1)
'MsgBox .LinkFormat.SourceFullName
sOriginalLinkSource = .LinkFormat.SourceFullName
sLinkSource = InputBox("Edit the link", "Link Editor",
sOriginalLinkSource)
If sLinkSource = sOriginalLinkSource Then
Exit Sub
End If
If sLinkSource = "" Then
' The user canceled; quit:
Exit Sub
End If
' Get the filename portion of the link in case it's a link to a range
Debug.Print Mid$(sLinkSource, 1, InStr(sLinkSource, ".") + 3)
' Is it a valid filename? Is the file where it belongs?
' Test against the filename portion of the link in case the link
includes
' range information
If Dir$(Mid$(sLinkSource, 1, InStr(sLinkSource, ".") + 3)) <> "" Then
.LinkFormat.SourceFullName = sLinkSource
.LinkFormat.Update
Else
MsgBox "Can't find " & sLinkSource
End If
End With
End Sub
Thanks,
Geoff Coco
(e-mail address removed)
--
Steve Rindsberg, PPT MVP
PPT FAQ:
www.pptfaq.com
PPTools:
www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA
www.PowerPointLive.com
================================================