How to insert an embedded picture?

后端 未结 3 1623
忘了有多久
忘了有多久 2020-11-27 21:15

xlApp.activesheet.Pictures.Insert(strImagePath) inserts pictures into a spreadsheet as a linked picture. If I send the spreadsheet out of our network the images

3条回答
  •  独厮守ぢ
    2020-11-27 21:50

    Note that you can set the required Width and Height parameters to -1, which then maintains the height and width of the original image!

    Activesheet.Shapes.AddPicture Filename:="C:\image.jpg", LinkToFile:=msoFalse, _
            SaveWithDocument:=msoTrue, Left:=0, Top:=0, Width:=-1, Height:=-1
    

    http://excelmatters.com/2013/11/25/default-picture-size-with-shapes-addpicture/

    (Added as another answer to increase visibility as I've struggled with this problem for ages and haven't found this solution documented anywhere else.)

提交回复
热议问题