I have a code that I've been using to insert a picture into a sheet, but I need it to insert a picture I can send not a link of that picture.
Sub CompressPicture()
Dim fName As String
Dim pic As Picture
Dim r As Range
fName = Application.GetOpenFilename( _
FileFilter:="Images (*.jpg;*.gif;*.png),*.jpg;*.gif;*.png", _
Title:="Please select an image...")
If fName = "False" Then Exit Sub
Set r = ActiveCell
Set pic = Worksheets(ActiveSheet.Name).Pictures.Insert(fName)
With pic
.ShapeRange.LockAspectRatio = msoFalse
.Left = r.Left
.Top = r.Top
.Width = r.Width * 8
.Height = r.Height * 22
.Select
End With
If TypeName(Selection) = "Picture" Then
Application.SendKeys "%a~"
Application.CommandBars.ExecuteMso "PicturesCompress"
End If
End Sub
Sub CompressPicture()
Dim fName As String
Dim pic As Picture
Dim r As Range
fName = Application.GetOpenFilename( _
FileFilter:="Images (*.jpg;*.gif;*.png),*.jpg;*.gif;*.png", _
Title:="Please select an image...")
If fName = "False" Then Exit Sub
Set r = ActiveCell
Set pic = Worksheets(ActiveSheet.Name).Pictures.Insert(fName)
With pic
.ShapeRange.LockAspectRatio = msoFalse
.Left = r.Left
.Top = r.Top
.Width = r.Width * 8
.Height = r.Height * 22
.Select
End With
If TypeName(Selection) = "Picture" Then
Application.SendKeys "%a~"
Application.CommandBars.ExecuteMso "PicturesCompress"
End If
End Sub