title: How can remove border of image when export from excel?
body: <p>This is my code export image from excel to file</p>
  
  <pre><code>For Each oShape In ActiveSheet.Shapes
      strImageName = oShape.TopLeftCell.Row &amp; "_" &amp; oShape.TopLeftCell.Column
      If oShape.Type = msoPicture Then
          oShape.Select
          'Picture format initialization
          Selection.ShapeRange.PictureFormat.Contrast = 0.5: Selection.ShapeRange.PictureFormat.Brightness = 0.5: Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic: Selection.ShapeRange.PictureFormat.TransparentBackground = msoFalse: Selection.ShapeRange.Fill.Visible = msoFalse: Selection.ShapeRange.Line.Visible = msoFalse: Selection.ShapeRange.Rotation = 0#: Selection.ShapeRange.PictureFormat.CropLeft = 0#: Selection.ShapeRange.PictureFormat.CropRight = 0#: Selection.ShapeRange.PictureFormat.CropTop = 0#: Selection.ShapeRange.PictureFormat.CropBottom = 0#: Selection.ShapeRange.ScaleHeight 1#, msoTrue, msoScaleFromTopLeft: Selection.ShapeRange.ScaleWidth 1#, msoTrue, msoScaleFromTopLeft
          '/Picture format initialization
          Application.Selection.CopyPicture
          Set oDia = ActiveSheet.ChartObjects.Add(0, 0, oShape.Width, oShape.Height)
          Set oChartArea = oDia.Chart
          oDia.Activate
          With oChartArea
              .ChartArea.Select
              .Paste
              .Export ("D:\images\" &amp; strImageName &amp; ".jpg")
          End With
          oDia.Delete 'oChartArea.Delete
      End If
  Next
  </code></pre>
  
  <p>Original Image not exist border, but in result file exist a border outsize of image:</p>
  
  <p><a href="https://i.stack.imgur.com/lGlT9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lGlT9.png" alt="enter image description here"></a></p>
  
  <p>How can keep original image when export from excel?</p>