title: Resizing OLEobject custom icon
body: <p>I have code to insert pdf invoice copies in customer's account statement. The code is working fine. Just the custom icon size is not as per the defined 15x51 (HxW). Please suggest how the code can resize the icon file to fit in this 15x51 box (the size of cells in column M as in below picture)? I am using a 16x16 icon file.</p>
  
  <p>Here is the current result.</p>
  
  <p><a href="https://i.stack.imgur.com/MfYzK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MfYzK.jpg" alt="enter image description here"></a></p>
  
  <pre><code>    Sub Insert_PDF_File()
      Application.ScreenUpdating = False
  
          Dim cell As Range
  
  ' loop each cell in column A
          For Each cell In Range("A10:A" &amp; Range("A" &amp; Rows.Count).End(xlUp).Row)
  ' make sure the cell is NOT empty before doing any work
               If Not IsEmpty(cell) Then
  
  ' create and insert a new OleObject based on the path
                  Dim ol As OLEObject
  ' ActiveWorkbook.path &amp; "\" &amp; cell &amp; ".pdf" will make the filename
                  Set ol = ActiveSheet.OLEObjects.Add( _
                                                      Filename:="C:\Invoices\Renamed" &amp; "\" &amp; cell &amp; ".pdf", _
                                                      Link:=False, _
                                                      DisplayAsIcon:=True, _
                                                      IconFileName:="C:\Users\pvishwas\Documents\WORK\Macros\PDF.ico", _
                                                      IconIndex:=0, _
                                                      Height:=15, Width:=51, IconLabel:="Open")
  ' align the OleObject with Column D - (0 rows, 3 columns to the right from column A)
                  With ol
                      .Top = cell.Offset(0, 12).Top
                      .Left = cell.Offset(0, 12).Left
  
                  End With
              End If
          Next
      Application.ScreenUpdating = True
  
      End Sub
  </code></pre>