title: How to add a textbox at a specific position in an ExcelSheet?
body: <p>Hello i try to add a Textbox on a specific place in an Excelsheet. Like from A34 to J39. But i have no clue how to do that. </p>
  
  <p>Here is what i tried:</p>
  
  <pre><code>excelSheet.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 100, 100, 200, 50);
  </code></pre>
  
  <p>Works but the textbox appears on a random place on the sheet.</p>
  
  <pre><code>Microsoft.Office.Tools.Excel.Controls.TextBox
  textBox1 = this.Controls.AddTextBox(
  this.Range["A1", "B2"], "textBox1");
  textBox1.Text = "Sample text";
  </code></pre>
  
  <p>This is from the MSDN Site. But wont work becouse you need a new mehtod for this and i am not supposed to add a new Method......</p>
  
  <pre><code>Range rng = UsedArea.Cells[rownum, cellnum];
  
  txtbox = sheet.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, rng.Left, rng.Top, txt.Width / 2, rng.Height); 
  </code></pre>
  
  <p>This is from SO but it says the range property cannot be changed......
  Mabey it has something to do with the office interop 15 stuff.</p>
  
  <p>So any help or advise would be great and thx for your time.</p>
  
  <p><strong>EDIT:</strong> Working C# Code to get a textbox in an excelsheet at any position:</p>
  
  <pre><code>    Excel.Range rng = excelSheet.get_Range("A34:J39");
      float left = (float)rng.Left;
      float top = (float)rng.Top;
      float width = (float)rng.Width;
      float height = (float)rng.Height;
  
      excelSheet.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, left, top, width, height).Select();
  </code></pre>