title: Why does this slides-creating loop in VBA PowerPoint not work?
body: <p>I have tried to create this script that would create 10 empty slides, but it doesn't work for some reason:</p>
  
  <pre><code>Sub CreatingSlides()
      Dim oPresentation As Presentation
      Set oPresentation = ActivePresentation
      Dim oSlide As Slide
      Dim oSlides As SlideRange
      Dim oShape As Shape
      Dim slideNumber As Integer
      Dim myindex As Integer
  
      Set myindex = 1
      ActivePresentation.Slides.add(Index:=myindex, Layout:=ppLayoutBlank).Select
      For myindex = 1 To 10
          myindex = myindex + 1
          ActivePresentation.Slides.add(Index:=myindex, Layout:=ppLayoutBlank).Select
      Next myindex
  End Sub
  </code></pre>
  
  <p>What have I done wrong here? Maybe my loop here is missing something?</p>