Hi I am trying to bring an image and a text file on the same row as a matched string in a cell an example would be 070.txt & 070.jpg. matching up with R17-8976-070. I seem to be able to bring in the text file alright but when I run the code for this the image comes in a long string of characters. Could someone please tell me what I am doing wrong? below is the code I am using
Sub InsertStuff2()
Dim myText As String
Dim myImage As Picture
Dim fileLoc As String
Columns("a:h").ColumnWidth = 13 ' adjust column width
Rows("1:8").RowHeight = 55 'adjust row height
Application.ScreenUpdating = False
fileLoc = "Macintosh HD:Users:paul-walker:Documents:VBA_Scripts:"
myText = Range("A1").Value & ".txt" '<<-- Text file name
myImage = Range("A1").Value & ".jpg" '<<-- Image file name
Set myTextFile = Workbooks.Open(fileLoc & myText)
myTextFile.Sheets(1).Range("A1").CurrentRegion.Copy _
ThisWorkbook.Sheets(1).Range("D1")
myTextFile.Close (False)
Set myImageFile = Workbooks.Open(fileLoc & myImage)
myImageFile.Sheets(1).Range("A1").CurrentRegion.Copy _
ThisWorkbook.Sheets(1).Range("E1")
myImageFile.Close (False)
Range("D1").WrapText = True
End Sub