title: VBA: Positioning 3 Graphs On A Single Power Point Slide
body: <p>I have VBA script that exports 3 graphs into the body of a single slide within an existing powerpoint template that I've created. My problem is that I'm not sure how to correctly position these graphs so that they are side by side by side. I've been trying to think of a way I can go about this and I've been trying to work out a For statement that increases the graph position with each graph.</p>
  <p>My most recent attempt:</p>
  <pre><code>On Error Resume Next
      Set PowerPointApp = GetObject(class:=&quot;PowerPoint.Application&quot;)
      If PowerPointApp Is Nothing Then Set PowerPointApp = CreateObject(class:=&quot;PowerPoint.Application&quot;)
      On Error GoTo 0
      Application.ScreenUpdating = False
      Set myPresentation = PowerPointApp.Presentations.Open(Filename:=&quot;X:\xxx\yyy.pptx&quot;)
      
  'For i = 1 To Worksheets(&quot;Graphs&quot;).ChartObjects.Count
  'Set cht = Worksheets(&quot;Graphs&quot;).ChartObjects(i)
  
  MySlideArrayc = Array(12)
  MyRangeArrayc = Array(Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;A&quot;), Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;B&quot;), Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;CC&quot;))
  
  For xc = LBound(MySlideArrayc) To UBound(MySlideArrayc)
      'Copy Excel Range
          MyRangeArrayb(xc).CopyPicture
  
      Set shpc = myPresentation.Slides(MySlideArrayc(xc)).Shapes.Paste
  
  Next
  
  Next xc
      
  
  
  
  myPresentation.Slides(Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;A&quot;)).ShapeRange.Left = 50
  myPresentation.Slides(Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;A&quot;)).ShapeRange.Top = 50
  
  
  myPresentation.Slides(Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;B&quot;)).ShapeRange.Left = 150
  myPresentation.Slides(Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;B&quot;)).ShapeRange.Top = 150
      
  Else
  myPresentation.Slides(Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;CC&quot;)).ShapeRange.Left = 300
  myPresentation.Slides(Worksheets(&quot;Graphs&quot;).ChartObjects(&quot;CC&quot;)).ShapeRange.Top = 300
  
  End If
  
  End Sub
  </code></pre>