VBA插入嵌入图片excel

Das*_*ete 11 excel vba excel-vba access-vba

我看过很多关于我们的帖子,xlApp.activesheet.Pictures.Insert(strImagePath)用VBA将图片插入电子表格,效果很好.唯一的问题是它将其作为链接图片插入.因此,如果我将电子表格发送出网络,图像就会失败.任何人都可以告诉我如何使用Pictures.Insert将图像作为嵌入图像放置,或者可能是另一种将其嵌入的方法?如果有帮助的话,我也会从访问中调用此方法.

Jos*_*ieP 21

你可以使用shapes.addpicture方法

activesheet.Shapes.AddPicture Filename:="C:\test\desert.jpg", linktofile:=msoFalse, _
            savewithdocument:=msoCTrue, Left:=0, Top:=0, Width:=100, Height:=100
Run Code Online (Sandbox Code Playgroud)

  • 不,你把Dim shpPic作为对象`然后使用`set shpPic = xlapp.activesheet.shapes.addpicture ...... (2认同)