title: How can I check if a chart is a line chart?
body: <p>I am attempting to check if a selected shape is a chart, and subsequently, if it is a line chart.</p>
  
  <p><strong>My attempt:</strong></p>
  
  <pre><code>Sub ChartSmooth(ByVal control As IRibbonControl)
  
  Dim activeShape As Shape
  
  'Determine Which Shape is Active
  If ActiveWindow.Selection.Type = ppSelectionShapes Then
  'Loop in case multiples shapes selected
      Dim shp As Shape
      For Each shp In ActiveWindow.Selection.ShapeRange
           Set activeShape = shp ' First shape selected
           Exit For
      Next
  
  'Now, reformat the selected shape if it is a chart
      With activeShape
          If .HasChart Then
              If .ChartType = xlLine Then
                  MsgBox "True" ' I will eventually put some code here to do something
              End If
          End If
      End With ' activeShape
  
  End If
  
  ActiveWindow.Selection.Unselect
  
  End Sub
  </code></pre>
  
  <p>What am I doing wrong?</p>