title: Shapes.Type....Delete in Excel/PPT VBA
body: <p>I am trying to delete an existing shape (picture) on a slide and have tried the following, and none of them work. As a bit of background, this code is running in Excel but interacting with powerpoint, and this is just a snippet of the code. Everything else is fine (and PPPres is already defined). I also tried indexing the shape (even though it is the only one on the slide) and using a for loop but still cannot seem to get it to work.</p>
  
  <pre><code> With PPPres.Slides(5).Shapes
      If Shapes.Type = msoPicture Then
         .Delete
      End If
   End With
  </code></pre>
  
  <p>*Error - Method or Data member not found (on .Delete). I know ".Delete" only works in a "with statement" but I have that so I don't know what is wrong. With that said I then tried the following:</p>
  
  <pre><code> If PPPres.Slides(5).Shapes.Type = msoPicture Then
           Shapes.Delete
   End If
  </code></pre>
  
  <p>*Error - Method or Data member not found (on .Type). I know ".Type" exists so I am confused on what the issue is.</p>
  
  <p>Thank you for your help!</p>