Hello, I wrote some code to look for external links to "file A" and replace them with links to "file B". The code is in PowerPoint, and in this PowerPoint file I have about 25 "objects" linked to excel (the objects are primarily just cells from excel pasted into PowerPoint as linked objects).
The code works, but it takes 7-8 minutes to run. Any idea why it takes so long or how to make it faster? It seems as all it's doing is finding and replacing text, so I'm confused as to why it takes so much time.
Relevant portion of code:
The code works, but it takes 7-8 minutes to run. Any idea why it takes so long or how to make it faster? It seems as all it's doing is finding and replacing text, so I'm confused as to why it takes so much time.
Relevant portion of code:
Code:
Dim newPath As String
Dim templateHome As String
Dim oshp As Shape
Dim osld As Slide
Dim vizFile As Workbook
Dim vizFname As String
Dim replacethis As String
Dim replacewith As String
'3. Update links:
'(Replace links to template file link with links to new copy of the file)
replacethis = templateHome & vizFname
replacewith = newPath & "\" & vizFname
On Error Resume Next
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
oshp.LinkFormat.SourceFullName = Replace(oshp.LinkFormat.SourceFullName, replacethis, replacewith)
oshp.LinkFormat.Update
Next oshp
Next osld