Solved

Powerpoint 2007: How to change Excel file link in powerpoint

Posted on 2012-03-14
6
1,224 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

809 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