Powerpoint linking to Excel

mycall65

New Member
Joined
Jan 5, 2005
Messages
19
I have a presentation full of links to one excel file where all the data is gathered and made presentable from other excel files.

This is a monthly excercise and therefore I have a new directory every month. When copying the entire directory Excel keeps the links to the other files, which are also in the same directory.

However, Powerpoint (in this same directory) keeps the links to the directory it originated from.

Microsoft aknowledges this as a known problem and advises the below macro in Powerpoint, which unfortunately does not work (or I'm doing something wrong).

Can somebody please help.

Sub RelPict()
Dim oSlide As Slide
Dim oShape As Shape
Dim lPos As Long
Dim strLink As String
'
' Loop through the presentation checking each shape
' on each slide to see if it is a linked picture.
'
For Each oSlide In ActivePresentation.Slides
For Each oShape In oSlide.Shapes
If oShape.Type = msoLinkedPicture Then
With oShape.LinkFormat
'
' Search from the right hand portion of the source
' file name and find the first backslash "\" character.
'
lPos = InStrRev(.SourceFullName, "\")
'
' Check to see if the link has already been modified.
'
If lPos <> Null Then
'
' Determine how long the file name is, by subtracting
' the position the "\" character was found at from
' the total length of the source file name.
'
lPos = Len(.SourceFullName) - lPos
'
' Extract the file name from the source file name, then
' assign the file name to the source file name, turning
' it into a relative path.
'
strLink = Right(.SourceFullName, lPos)
.SourceFullName = strLink
End If
End With
End If
Next oShape
Next oSlide
End Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,224,875
Messages
6,181,516
Members
453,050
Latest member
Obil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top