title: Positioning multiple Excel tables on separate PowerPoint slides
body: <p>I am pasting ranges from Excel to Powerpoint as Tables.</p>
  
  <p>The problem is that when I paste the first table, positioning works fine (.Top and .Left) but the tables I paste after the first one get positioned relative to the first table.</p>
  
  <p>The .Top becomes the distance between the upper left corner of the table and the upper side of the first table's position (not to the upper side of the slide, as it should be!) and the same thing happens to .Left (it represents the distance between the upper left corner of the table and the left side of the first table). </p>
  
  <p>The code is the following:</p>
  
  <pre><code>Sub ExportaraPowerPoint()
  
  Dim pptApp As PowerPoint.Application
  Dim pptPres As PowerPoint.Presentation
  Dim pptSlide As PowerPoint.Slide
  Dim pptShape As PowerPoint.Shape
  Dim excelTable As Excel.Range
  Dim SlideTitle As String
  Dim SlideText As String
  Dim SlideObject As Object
  Dim pptTextbox As PowerPoint.Shape
  Dim SlideNumber As String
  Dim xlTable As PowerPoint.Shape
  
  'Check is PPT is open and create if not
  On Error Resume Next
  Set pptApp = GetObject("", "PowerPoint.Application")
  Err.Clear
  If pptApp Is Nothing Then Set pptApp = CreateObject(class:="PowerPoint.Application")
  pptApp.Visible = True
  pptApp.Activate
  
  'Add presentation
  Set pptPres = pptApp.Presentations.Add
  pptPres.PageSetup.SlideSize = ppSlideSizeOnScreen
  pptPres.ApplyTemplate "c:\Program Files\Microsoft Office\Templates\1033\Blank.potx"
  
  'Assing Tables
  Set excelTable1 = Worksheets("TDSACI").Range("N246:U259")
  Set excelTable2 = Worksheets("TDCSD").Range("N215:U223")
  
  'Slide 1:
  Set pptSlide = pptPres.Slides.Add(1, ppLayoutTitleOnly)
  excelTable1.Copy
  pptSlide.Shapes.PasteSpecial (ppPasteDefault)
  pptSlide.Shapes(2).Width = 670.4
  pptSlide.Shapes(2).Height = 292
  pptSlide.Shapes(2).Left = 24.4
  pptSlide.Shapes(2).Top = 90.4
  
  'Slide 2:
  Set pptSlide = pptPres.Slides.Add(2, ppLayoutTitleOnly)
  excelTable2.Copy
  pptSlide.Shapes.PasteSpecial (ppPasteDefault)
  pptSlide.Shapes(2).Width = 670.4
  pptSlide.Shapes(2).Height = 292
  pptSlide.Shapes(2).Left = 24.4
  pptSlide.Shapes(2).Top = 90.4
  </code></pre>
  
  <p>I know that the table is always the Shape Index number 2, so that is not a problem. </p>
  
  <p>According to numbers, the position of both tables should be the same.</p>