Didn't know where this belonged, but since it's a VBA question I figured it's safe to post in this section. I need to update links in powerpoint vba then immediately break the link that was updated. I have a template created where the macro kicks off and pulls data to a file that has links to the powerpoint. Once the data needed is extracted it is in the format as it needs to be in, then the charts get updated and saved as the correct filename/extension. At this point it is how I planned. However, the excel file that the charts are linked to will be getting altered and written over each subsequent time the macro is ran. So, anybody that refreshes these files will get the wrong data for that 'named file'. I thought I found code to break the links, but apparently the object type in this occurrence is 'msoPlaceholder' and I can't get the code to function as such. I can get it done manually, which essentially the entire reason why there is VBA so we can get this done in one fell swoop.
Found this code online, as well as about 4 others and I am losing my mind.
Found this code online, as well as about 4 others and I am losing my mind.
Code:
Dim oSld As Slide
Dim oSh As Shape
For Each oSld In ActivePresentation.Slides
For Each oSh In oSld.Shapes
If oSh.Type = msoPlaceholder Then
oSh.LinkFormat.BreakLink
End If
Next ' Shape
Next ' Slide