I have some VBA code that adds images to a spreadsheet, and its all fine but when i send it out externally obviously the links wont work anymore as the other user is not on my network
how can i amend this code to insert the actual image in to the spreadsheet instead of linking to it
I am aware the excel file may get large in this scenario but they are small 20KB thumbnails i am inserting
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPict As Picture
Dim PictureLoc As String
On Error GoTo EH
Application.EnableEvents = False
If Target.Column = 1 Then
'Pictures.Delete
PictureLoc = "\\ca-sbs-01\t\Shared\ExcelImages\" & Target.Value2 & ".jpg"
With Target.Offset(, 1)
Set myPict = ActiveSheet.Pictures.Insert(PictureLoc)
.RowHeight = myPict.Height
myPict.Top = .Top
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With
End If
EH:
Application.EnableEvents = True
End Sub