Solved

Powerpoint 2007: How to change Excel file link in powerpoint

Posted on 2012-03-14
6
1,205 Views
Last Modified: 2012-04-17
Hi, I have created some charts and tables in Excel and would like to automatically have them linked in a ppt file.  So I copied the charts and tables and did paste special and paste link in ppt.  However, I am unable to change the link source in ppt to a different Excel file by clicking on the Office button - Prepare - Edit Links to File - Change Source and choose the new Excel file.

For example I have a file named File Jan.xlsm already linked to the ppt.  Then I tried to redirect the link to File Feb.xlsm.  The error message is "The link file is not unavailable..."

Below are the linked path.  I can see the second half was not updated.

Original path - C:\Test\Feb Jan.xlsm!OPEX![File Jan.xlsm]Sheet1 Chart 1

New path - C:\Test\File Feb.xlsm!OPEX![File Jan.xlsm]Sheet1 Chart 1

Can someone help?  Thanks.
0
Comment
Question by:JCJG
  • 4
  • 2
6 Comments
 
LVL 41

Accepted Solution

by:
dlmille earned 250 total points
ID: 37723328
It works for me, but its not perfect.  When I change the link, I get a piece of the spreadsheet in the chart as well.

How about making a copy of "File Jan.xlsm" to "File PPT.XLSM"

Then save and test.

Then instead of updating links, just copy/save "File Feb.xlsm" over the top of "File PPT.XLSM"

So, links aren't changing, just the destination file is getting overwritten.

When I do that I get a perfect replacement (no goofs like update links and changing files).

How does that work for you?

Dave
0
 
LVL 23

Assisted Solution

by:JSRWilson
JSRWilson earned 250 total points
ID: 37728233
If you know how to use vba code

You can try this with the chart selected in PPT

Sub switch()
On Error Resume Next
Dim oldlink As String
Dim newlink As String
oldlink = "Jan" ' just the filename
newlink = "Feb"
With ActiveWindow.Selection.ShapeRange(1).LinkFormat
.SourceFullName = Replace(.SourceFullName, oldlink, newlink)
.Update
End With
End Sub

Open in new window


How to use code
0
 
LVL 41

Expert Comment

by:dlmille
ID: 37728246
@JRWilson - worked like a charm for me.  PS - your link has no linkage.

Dave
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 41

Expert Comment

by:dlmille
ID: 37728253
@JRWilson - Would this need to be coded differently?  It would seem that you should be able to update links for all slides in the presentation, as opposed to one shape at a time, correct?

Sub switch()
Dim mySlide As Slide
Dim myShape As Shape

    On Error Resume Next
    Dim oldlink As String
    Dim newlink As String
    oldlink = "feb"    ' just the filename
    newlink = "jan"
    
    For Each mySlide In ActivePresentation.Slides
        For Each myShape In mySlide.Shapes
            With myShape.LinkFormat
                .SourceFullName = Replace(.SourceFullName, oldlink, newlink)
                .Update
            End With
        Next myShape
    Next mySlide
End Sub

Open in new window


Dave
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 37757796
Hi

Yes there a typo in the Link

How to use vba

Your code is basically correct BUT you really should check that the shape IS a linked object (I guess On Error Resume Next should work though)

Sub switch()
Dim mySlide As Slide
Dim myShape As Shape

    On Error Resume Next
    Dim oldlink As String
    Dim newlink As String
    oldlink = "feb"    ' just the filename
    newlink = "jan"
    
    For Each mySlide In ActivePresentation.Slides
        For Each myShape In mySlide.Shapes
        If myShape.Type = msoLinkedOLEObject Then
            With myShape.LinkFormat
                .SourceFullName = Replace(.SourceFullName, oldlink, newlink)
                .Update
            End With
        End If
        Next myShape
    Next mySlide
End Sub

Open in new window

0
 
LVL 41

Expert Comment

by:dlmille
ID: 37858595
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction In all recent versions of PowerPoint it is possible to trigger animations. This means the animation takes place when a certain shape is clicked. This allows you to run animation “on demand” and outwith the normal sequence of mouse cl…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now