HyperLinks to Excel files in PowerPoint presentation

M

Michal

Hi,

I need to prepare a navigator - mini presentation with few slides that
will have hyperlinks to Excel files.

The excel files have predictable names, but the name change with the
data waves coming. The Excel files can be in the same folder or in
subfolder - at the end of the day I'll prepare a portable presentation
and send it with a viewer, so the hyperlinks will be relative anyway.

The number of hyperlins may change a bit. The ideal situation would be
if the links were in textboxes, so I can check the text in the box
and, on the basis of it, find the proper file for each link. The list
of text-link may be prepared in Excel worksheet for example.

I have found some hints how to change the links, but the examples use
msoLinkedOLEObject and after that .LinkFormat that does not work with
text boxes. This is great for updating charts source data, but I don't
know how to use is in my case.

Below I enclose the quoted hints found on this newsgroup (thanks for
Shyam Pillai)

I'd be verz grateful for any ideas how to solve it.


Regrads,


Michal

Liczba trafień 2
Autor:Shyam Pillai ([email protected])
Temat:Re: Code to change an Excel Object source file
View: Complete Thread (liczba dokumentów: 2)
Original Format
Grupy dyskusyjne:microsoft.public.powerpoint
Data:2002-03-21 18:14:50 PST


Glauco,
I am not very sure about the requirement, do you wish to change the
name of
the source path information.
Here is an example of updating links. I'm sure you could make the
necessary
modifications to suit it to your needs. This example updates all the
linked
file paths to reflect the new path "C:\Documents and
Settings\Documents\"

'------ Code begins here -----
Public Const NewLinkPath = "C:\Documents and Settings\Documents\"

Sub UpdateToNewLinks()
Dim I As Integer
Dim J As Integer

' Create a variable to store the file reference string.
Dim LinkFileName As String

' Set a For loop to go from slide 1 to the last slide in the
presentation.
For I = 1 To ActivePresentation.Slides.Count

' Select the slide based on the index value.
With ActivePresentation.Slides(I)
' Loop through all the objects on slide.
For J = 1 To .Shapes.Count

' Use only shapes on the slide.
With .Shapes(J)

' If the shape's type is an OLE object then...
If .Type = msoLinkedOLEObject Then

' Ideally you should determine the type of OLE Object before working
on it.
' In this case I am assuming only wav/avi files have been linked.
' Change the path to new source and set the update type to Automatic.
With .LinkFormat

' Now we shall extract the filename from the complete path.
ExtractFilename
is a function
' written by me to extract only the filename from a fully qualified
path.
' Write your own "ExtractFileName" function. I have not included the
code
for it
' In case you have difficulty with it then get in touch with me.

LinkFileName = ExtractFilename(.SourceFullName)

' Concatinate the new Path and filename and assign it to the
SourceFullName

.SourceFullName = NewLinkPath & LinkFileName
.AutoUpdate = ppUpdateOptionAutomatic

End With
End If

End With
Next J
End With
Next I
' Update all links in the presentation, so that the changes are
' visible and the source file locations are correct on the screen.
ActivePresentation.UpdateLinks
End Sub
' -------- Code ends here ---------

Regards
Shyam Pillai

Handout Wizard
http://www.mvps.org/skp/how/
 
S

Steve Rindsberg

I need to prepare a navigator - mini presentation with few slides that
will have hyperlinks to Excel files.

What sort of links? I can think of three or four different ways of doing this
offhand and each would require a different approach. If you were to create the
link manually, what steps would you follow?
The excel files have predictable names, but the name change with the
data waves coming. The Excel files can be in the same folder or in
subfolder - at the end of the day I'll prepare a portable presentation
and send it with a viewer, so the hyperlinks will be relative anyway.

Have a look here - depending on the type of links you need, this might be
easily adaptible:

Create an index with links to a folder full of PPT files
http://www.rdpslides.com/pptfaq/FAQ00291.htm
The number of hyperlins may change a bit. The ideal situation would be
if the links were in textboxes, so I can check the text in the box
and, on the basis of it, find the proper file for each link. The list
of text-link may be prepared in Excel worksheet for example.

I have found some hints how to change the links, but the examples use
msoLinkedOLEObject and after that .LinkFormat that does not work with
text boxes. This is great for updating charts source data, but I don't
know how to use is in my case.

Below I enclose the quoted hints found on this newsgroup (thanks for
Shyam Pillai)

I'd be verz grateful for any ideas how to solve it.

Regrads,

Michal

Liczba trafień 2
Autor:Shyam Pillai ([email protected])
Temat:Re: Code to change an Excel Object source file
View: Complete Thread (liczba dokumentów: 2)
Original Format
Grupy dyskusyjne:microsoft.public.powerpoint
Data:2002-03-21 18:14:50 PST


Glauco,
I am not very sure about the requirement, do you wish to change the
name of
the source path information.
Here is an example of updating links. I'm sure you could make the
necessary
modifications to suit it to your needs. This example updates all the
linked
file paths to reflect the new path "C:\Documents and
Settings\Documents\"

'------ Code begins here -----
Public Const NewLinkPath = "C:\Documents and Settings\Documents\"

Sub UpdateToNewLinks()
Dim I As Integer
Dim J As Integer

' Create a variable to store the file reference string.
Dim LinkFileName As String

' Set a For loop to go from slide 1 to the last slide in the
presentation.
For I = 1 To ActivePresentation.Slides.Count

' Select the slide based on the index value.
With ActivePresentation.Slides(I)
' Loop through all the objects on slide.
For J = 1 To .Shapes.Count

' Use only shapes on the slide.
With .Shapes(J)

' If the shape's type is an OLE object then...
If .Type = msoLinkedOLEObject Then

' Ideally you should determine the type of OLE Object before working
on it.
' In this case I am assuming only wav/avi files have been linked.
' Change the path to new source and set the update type to Automatic.
With .LinkFormat

' Now we shall extract the filename from the complete path.
ExtractFilename
is a function
' written by me to extract only the filename from a fully qualified
path.
' Write your own "ExtractFileName" function. I have not included the
code
for it
' In case you have difficulty with it then get in touch with me.

LinkFileName = ExtractFilename(.SourceFullName)

' Concatinate the new Path and filename and assign it to the
SourceFullName

.SourceFullName = NewLinkPath & LinkFileName
.AutoUpdate = ppUpdateOptionAutomatic

End With
End If

End With
Next J
End With
Next I
' Update all links in the presentation, so that the changes are
' visible and the source file locations are correct on the screen.
ActivePresentation.UpdateLinks
End Sub
' -------- Code ends here ---------

Regards
Shyam Pillai

Handout Wizard
http://www.mvps.org/skp/how/

--
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
================================================
 
M

Michal

Steve Rindsberg said:
What sort of links? I can think of three or four different ways of doing this
offhand and each would require a different approach. If you were to create the
link manually, what steps would you follow?

Steve,

Your sub MakeLotsOfLinks() solves everything. Of course I had to adapt
it a bit (xls files, modifications about textbox positioning etc.),
but the idea was there.

Thank you very much for, as usual, very professional and accurate
answer.

Regards,


Michal
 
S

Steve Rindsberg

Your sub MakeLotsOfLinks() solves everything. Of course I had to adapt
it a bit (xls files, modifications about textbox positioning etc.),
but the idea was there.

I figured you'd be able to run with it. Great!
Thank you very much for, as usual, very professional and accurate
answer.

You're very welcome!

--
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
================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top