title: Excel - VBA: Adressing and modifing a PowerPoint-Shape by Label-Name
body: <p>I would like to change a shape in a Powerpoint from Excel, but I can't address it by name (label). Is there a trick?</p>
  <p>In the presentation the slide is created by a master slide and this master slide has a rounded rectangle. This rectangle should be longer or shorter in the actual presentation (RGB-Colors). But I can not get it right. Could someone help me?</p>
  <pre><code>Sub createPPT()
  
      Dim oPPApp As Object, oPPPrsn As Object, oPPSlide As Object
      Dim oPPShape As Object
      Dim FlName As String
      Dim PPTFieldname As String
  
      '~~&gt; Change this to the relevant file
      FlName = &quot;C:\testpraesentation.pptx&quot;
  
      '~~&gt; Establish an PowerPoint application object
      On Error Resume Next
      Set oPPApp = CreateObject(&quot;PowerPoint.Application&quot;)
  
      If Err.Number &lt;&gt; 0 Then
          Set oPPApp = CreateObject(&quot;PowerPoint.Application&quot;)
      End If
      Err.Clear
      On Error GoTo 0
  
      oPPApp.Visible = msoTrue
  
      '~~&gt; Open the relevant powerpoint file
      Set oPPPrsn = oPPApp.Presentations.Open(FlName)
      '~~&gt; Change this to the relevant slide which has the shape
      Set oPPSlide = oPPPrsn.Slides(3)
      '~~&gt; Change this to the relevant shape
      Set oPPShape = oPPSlide.Shapes(&quot;Textfeld6&quot;)
  
  
      '~~&gt; Write to the shape
      oPPShape.TextFrame.TextRange.Text = _
      Tabelle1.Range(&quot;A1&quot;).Value
  
  
  
      '''''''''''''''''''' 
      This is the part
      '''''''''''''''''''' 
      oPPSlide.Shapes(&quot;Säule8&quot;) Type:=msoShapeRoundedRectangle, _
      Left:=500, Top:=500, Width:=Tabelle1.Range(&quot;C6&quot;).Value, Height:=Tabelle1.Range(&quot;C7&quot;).Value
      
      '''''' END ''''''''
  End Sub
  </code></pre>
  <p>Anyone?</p>
  <p>xSodax</p>