Macro for embedding images vs inserting

luke4541

New Member
Joined
Apr 7, 2014
Messages
1
Hi,
I am trying to make a macro that will embed images into a worksheet for my company. I researched online and put one together from stuff I've seen posted but when I email the file, the receiver can not see the image. I believe it is because "inserting" a picture only inserts a link to the picture but not the actual picture. Is there a way to embed the picture using the same macro without the sender having to send the picture and the worksheet?

Sub photo1()
'
' photo1 Macro
'
'

Application.ScreenUpdating = False
'varible Picture1 is inserted down below - ***change both***
Picture1 = Application.GetOpenFilename("Picture,*.JPG,Picture,*.JPEG,Picture,*.GIF,Picture,*.BMP")
'edit "("Picture,*.*")" section to add or chanve visible file types

Range("c1419:i1434").Select
ActiveSheet.Pictures.Insert(Picture1).Select
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 204
Selection.ShapeRange.Width = 225
Application.ScreenUpdating = True

End Sub

Thank you inadvance for any help you can give
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try this:-

Dim PicLocation As String
Dim MyRange As String

MyRange = Selection.Address

PicLocation = Application.GetOpenFilename(strFileType, , _
Title, , MultiSelect)
If PicLocation <> "False" Then
Sheets("Sheet1").Pictures.Insert(PicLocation).Select
Else
Exit Sub
End If

With Selection.ShapeRange
.LockAspectRatio = msoTrue
If .Width > .Height Then
.Width = Range(MyRange).Width
If .Height > Range(MyRange).Height Then .Height = Range(MyRange).Height
Else
.Height = Range(MyRange).Height
If .Width > Range(MyRange).Width Then .Width = Range(MyRange).Width
End If
End With

With Selection
.Placement = xlMoveAndSize
.PrintObject = True
End With
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top