在excel中更改形状背景图片

时间:2020-04-24 15:36:31

标签: excel vba

我正在尝试插入图片以从工作表中进行调整。我在工作表中有一个名为“ MyPic”的嵌入式图片。我想用这张照片填充形状。我尝试了以下代码。

With Selection.ShapeRange.Fill
         Set imgpath = Worksheets("Static").Shapes("MyPic") 'this is picture
        .visible = msoTrue
        '.UserPicture "C:\Users\ak\Desktop\settingsImg.jpg" 'working
        '.UserPicture = Worksheets("Static").Range("M2").value 'not working
         .UserPicture = imgpath 'not working
        .TextureTile = msoFalse
End with

我的问题类似于此线程https://www.mrexcel.com/board/threads/vba-excel-change-shape-fill-to-existing-picture-from-another-sheet.927668/ 谢谢

0 个答案:

没有答案