Solved

Powerpoint 2007: How to change Excel file link in powerpoint

Posted on 2012-03-14
6
1,240 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 42

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 42

Expert Comment

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

Dave
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 42

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 42

Expert Comment

by:dlmille
ID: 37858595
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel if statement 3 15
Distribute Values over date range 15 33
Aggregate numbers in Column A in one cell, separated by commas 5 29
first name and last initial in excel 11 28
PowerPoint is the go-to presentation software for millions of users around the world. Many presentations use basic text features but you can really make special text jump out of your slide by applying this bubble text design process. This article ha…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

791 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