I was trying to insert some pictures that are saved on my desktop to an excel file.
I found that some online codes worked well. But it seemed that those inserted pictures were not saved with the documents - the inserted pictures won't be displayed when I opened the file on another computer. I am wondering how I should tweak the codes so it can save the inserted pictures within the excel? If possible with VBA, how to adjust the inserted pictures to their 50% dimensions? I am completely new to VBA. Sorry for this basic question.
Sub add_pictures_R2()
Dim i%, ppath$
For i = 2 To 145   
    ' file name at column A
    ppath = "C:\Users\myname\output\" & CStr(Cells(i, 1).Value) & ".png"
    If Len(Dir(ppath)) Then
        With ActiveSheet.Pictures.Insert(ppath)
        With .ShapeRange
            .LockAspectRatio = msoTrue
            .Width = 75
            .Height = 300
        End With
        .Left = ActiveSheet.Cells(i, 10).Left
        .Top = ActiveSheet.Cells(i, 10).Top
        .Placement = 1
        .PrintObject = True
    End With
    End If
    
Next
End Sub