how to change the source of PPT and update the links.

I have one PPT which is linked to excel for exa , if i one to make presentaion of feb'17 month so i want to update the link through Feb'16 master sheet and if i want to make the Presentaion of Mar'17  so i want to use Mar'17 master dump.

can you guys please help me to Provide VBA code that every time i select my excel path ( Master Excel sheet path from where all PPT i want to create ) so all PPT's get updated...

please help me out,
Rahul RawatAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rajul RajInformation Security OfficerCommented:
Sub changeLinkTargets()

Dim pptSlide As Slide
Dim pptShape As Shape

Dim oldString As String
oldString = "\\serverXY\DataFiles"
Dim newString As String
newString = "\\serverAQ\DataFiles"

For Each pptSlide In ActivePresentation.Slides
    For Each pptShape In pptSlide.Shapes
        If pptShape.Type = msoLinkedOLEObject Or pptShape.Type = msoLinkedPicture Then
            With pptShape.LinkFormat
                If InStr(1, UCase(.SourceFullName), UCase(oldString)) Then
                    .SourceFullName = Replace(.SourceFullName, oldString, newString)
                End If
            End With
        End If
    DoEvents
    Next pptShape
DoEvents
Next pptSlide

End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.