Solved

Powerpoint 2007: How to change Excel file link in powerpoint

Posted on 2012-03-14
6
1,251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

740 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