Solved

Powerpoint 2007: How to change Excel file link in powerpoint

Posted on 2012-03-14
6
1,213 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most folk recognise that Microsoft Excel, being a numbers-and-formulae-centric application attracts programmers due to the natural fit in mindset. Conversly, when opening Microsoft's dominant presentation creative application, few consider what…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

862 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

23 Experts available now in Live!

Get 1:1 Help Now