PowerPoint - Break link of picture inserted and linked

Macro_learner

New Member
Joined
May 13, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Good morning,

I searched the web for an answer, tested few but without success. Please move this to the correct forum if needed.

I have a PowerPoint with several slides, each with one or more pictures linked to saved png files.
They were added using this path:
Insert Tab / Pictures / This Device / *select picture png* / Insert and link
1715599275319.png

Once the PowerPoint is ready I want to run a Macro to break the links of these pictures.
I tried the VBA below and some variations but it doesn't work.
I'm new to VBA so I assume the issue is that these "linked pictures" are not "msoPlaceholder", but I can't fine online what other "mso*" exists or what ".type" is a linked picture.

VBA Code:
Sub BreakAllLinks()

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

End Sub

Hope someone can help me.
Thanks.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,216,500
Messages
6,131,016
Members
449,615
Latest member
Nic0la

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top