Solved

Edit Multiple Links in PowerPoint from Excel with VBA

Posted on 2013-11-19
2
6,546 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 50

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Setting the Scene PowerPoint is a creative tool in the right hands but it also includes a much underutilised programming dimension. In this beginner level article, we're going to show you some of some key elements of programming PowerPoint using th…
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 the scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 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