title: Get Excel Range including all shape objects
body: <p>In a VSTO (C#) project I want to take the UsedRange including the shape objects like pictures and charts.</p>
  
  <p><strong>1. Is there a way to get the UsedRange with shape objects?</strong></p>
  
  <p>Since I couldn't find such a method, I thought of calculating the edges by using this:</p>
  
  <pre><code>foreach (Excel.Shape shape in shapeObjects)
  {
       float shapeBottom = shape.Top + shape.Height;
       float shapeRight = shape.Left + shape.Width;
       if (maxBottom &lt; shapeBottom)
       {
           maxBottom = shapeBottom;
       }
       if (maxRight &lt; shapeRight)
       {
           maxRight = shapeRight;
       }
   }
  
   Excel.Range r = &lt;XXX&gt;(maxBottom, maxRight);
  </code></pre>
  
  <p>So now I have the problem of getting the Range from maxBottom and maxRight.</p>
  
  <p><strong>2. Is there a way to get a Range object by giving the width and height?</strong></p>