|
帮忙看看我这个代码怎么用ActiveSheet.Shapes.AddPicture来写,谢谢
Private Sub CommandButton1_Click()
On Error Resume Next
Dim filefilter1, filennames As String
filefilter1 = ("所有图片文件 (*.jpg;*.bmp;*.png;*.gif),*.jpg;*.bmp;*.png;*.gif")
filennames = Application.GetOpenFilename(filefilter1, , "请选一个图片文件", , MultiSelect:=False)
With ActiveSheet.Pictures.Insert(filennames)
.ShapeRange.LockAspectRatio = msoFalse
.Left = ActiveCell.Left
.Top = ActiveCell.Top
.Width = Selection.Width
.Height = Selection.Height
End With
End Sub |
|