title: Shape unknown member: invalid request. To select a shape, its view must be active
body: <p>I have a PowerPoint macro that takes pictures and adds them to an open slideshow. When I try to run the macro after clicking below the list of slides on the left of the screen (which causes a solid blinking horizonal bar underneath the last slide), I get the error:</p>
  
  <pre><code>Runtime error '-2147188160 (80042240)': 
  Shape unknown member: invalid request. To select a shape, its view must be active
  </code></pre>
  
  <p>I figured this was because I didn't have a valid object selected so I added a debug statement to determine what the selection was:</p>
  
  <pre><code>If ActiveWindow.Selection.Type = 0 Then
     MsgBox "0"
  End If
  If ActiveWindow.Selection.Type = 1 Then
     MsgBox "1"
  End If
  If ActiveWindow.Selection.Type = 2 Then
     MsgBox "2"
  End If
  If ActiveWindow.Selection.Type = 3 Then
     MsgBox "3"
  End If
  </code></pre>
  
  <p>The first image to get added causes a <code>1</code> to be displayed and the picture is added correctly but then error displays and macro stops. Annoyingly, when I try to run this in debug mode, it works every time. I can only assume I'm somehow manually fixing the problem on accident when I debug it.  </p>
  
  <p>The statement that's causing the problem:</p>
  
  <pre><code>ActiveWindow.Selection.SlideRange.Shapes.AddPicture(//file information//).Select 
  
  //the line after
  ActiveWindow.Selection.ShapeRange.ZOrder msoSendToBack
  </code></pre>