title: VB.NET Shapes.AddPicture with aspect ratio
body: <p>I have a program written in vB.NET. I have a problem i am "exporting" an excel file with some data from database. One of the data has a link to file in it. I want to put this image (in the link) to the excel, It all works good until i have. for example image that is wide, or a tall one (landscape or portrait). I am using this code to poste the image to the excel file:</p>
  
  <pre><code>objWorkSheet.Shapes.AddPicture(linktofile, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoTrue, Left:=10, Top:=419, Height:=285, Width:=510)
  </code></pre>
  
  <p>so the proble is how to put the <code>AspectRatio := True</code> to the code... </p>