Solved

Edit Multiple Links in PowerPoint from Excel with VBA

Posted on 2013-11-19
2
6,349 Views
Last Modified: 2013-11-21
Experts, I have searched and searched for months for an answer...

I have one PowerPoint presentation template that will be distributed to multiple people to their desktops and a multitude of paths. It might even be renamed by the user. The slides are linked to multiple tables and graphs within one Excel file that could also be renamed by the user to reflect the client name.

(1) Is there a way to have the user open a form or something within the PowerPoint template and change the Excel file name and path name with ease to update the links. Is there VBA code that would accomplish this?

(2) Bonus: Ideally, the links would embed after this action with a prompt to rename the file, but I know I'm asking for a miracle. Is there VBA code that would accomplish this?
0
Comment
Question by:toddnchristy
2 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39661677
Hi,

pls try

Sub Macro()

    Set XL = CreateObject("Excel.Application")
     
    XLFile = XL.Application.GetOpenFilename(, , "Select Excel File")
    For Each sld In ActivePresentation.Slides
        For Each shp In sld.Shapes
            If shp.Type = msoLinkedOLEObject Then
                With shp.LinkFormat
                    strName = .SourceFullName
                    intIdx = InStr(1, strName, "!")
                    If intIdx > 0 Then
                        strNewPath = XLFile & Mid(strName, intIdx, Len(strName) - intIdx + 1)
                    Else
                        strNewPath = XLFile
                    End If
                    .SourceFullName = strNewPath
                End With
            End If
        Next shp
    Next sld
set XL = Nothing
End Sub

Open in new window

Regards
0
 

Author Closing Comment

by:toddnchristy
ID: 39667630
Works really well! Thank you so much!

The caution to others is that it take a while to loop through when you have multiple links—even to the same file.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel 2013 13 48
Excel Need to return the text of a filter column 11 19
how to add loop into this VBA 3 27
Creating An Intelligent Dropdown 8 24
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…
 Regular Expressions Microsoft Word has sophisticated search tools that can search for patterns. For example if you wanted to search for all UK phone numbers that followed a pattern of five digits, a space and then six digits you can easily do th…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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…

808 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