title: Resizing chart in powerpoint after inserting it from excel (Excel VBA)
body: <p>I have some code that takes a chart in <a href="/questions/tagged/excel" class="post-tag" title="show questions tagged 'excel'" rel="tag">excel</a> and pastes it into a <a href="/questions/tagged/powerpoint" class="post-tag" title="show questions tagged 'powerpoint'" rel="tag">powerpoint</a> slide. However, once it is pasted into <a href="/questions/tagged/powerpoint" class="post-tag" title="show questions tagged 'powerpoint'" rel="tag">powerpoint</a>  I'm not sure how to resize the chart. I've looked into finding which number "shape" it is and I can do this manually but I don't know how to automate this. Any help would be appreciated, thanks!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Sub AddChartToPPT(PPT As PowerPoint.Application, Slide As Integer, Chart As String, FromTop As Double, FromLeft As Double, Length As Double, Width As Double)
  Dim activeslide As PowerPoint.Slide
  PPT.ActiveWindow.View.GotoSlide Slide
  Set activeslide = PPT.ActivePresentation.Slides(Slide)
  ActiveSheet.ChartObjects(Chart).Activate
  ActiveChart.ChartArea.Copy
  activeslide.Shapes.PasteSpecial(DataType:=ppPasteMetafilePicture).Select
  PPT.ActiveWindow.Selection.ShapeRange.Left = FromLeft
  PPT.ActiveWindow.Selection.ShapeRange.Top = FromTop
  'Need to add scaling code
  End Sub
  </code></pre>