|
楼主 |
发表于 2018-8-31 17:27
|
显示全部楼层
Public path_str As String
Sub pic_insert()
If Trim(path_str) = "" Then
path_str = InputBox("请输入图片服务器路径:" & Chr(13) & Chr(10) & "例如:\\192.168.0.9\image\", "picture_path")
End If
On Error Resume Next
Dim MR As Range
For Each MR In Selection
If Not IsEmpty(MR) Then
MR.Select
ML = MR.Left
MT = MR.Top
MW = MR.Width
MH = MR.Height
ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select
Selection.ShapeRange.Fill.UserPicture _
path_str & MR.Value & ".jpg"
End If
Next
End Sub
|
|