Private Sub InsertImageWithLink(ws As Worksheet, rng As Range, imgPath As String, imgCol As Long)
Dim shp As Shape
Set shp = ws.Shapes.AddPicture(imgPath, msoTrue, msoFalse, _
ws.Cells(1, imgCol).Left, rng.Top, ws.Columns(imgCol).Width, rng.Height)
If Not shp Is Nothing Then
shp.LockAspectRatio = 保持纵横比
shp.Placement = xlMoveAndSize
shp.Top = rng.Top
ws.Hyperlinks.Add shp, imgPath
End If
End Sub
插图后再次调整Top就正常了
KVP函数专家、创作者俱乐部成员
KVP函数专家、创作者俱乐部成员