I found this insert macro but I cannot get it to work.
The instructions said...
Column A = imagename (AL-100Y)
Column B = imagepath (c:vonnieimages)
Column C = place to insert image
Image extension can be jpg or gif
I put in column A 01
In column B C:Pictures
I can not get this to work. Can someone tell me what might be wrong? Do I need more in A and B. Thanks
Code:
Sub InsertPictures()
Dim row As Long
Dim picPath As String
Dim Picture As Object
row = 1
On Error Resume Next
While Cells(row, 1) <> ""
Cells(row, 3).Select
' just guess what type of picture it is: .jpg or .gif
picPath = Cells(row, 2) & Cells(row, 1) & ".gif"
ActiveSheet.Pictures.Insert(picPath).Select
picPath = Cells(row, 2) & Cells(row, 1) & ".jpg"
ActiveSheet.Pictures.Insert(picPath).Select
Set Picture = Selection
'set cell height to picture size
Picture.Top = Picture.TopLeftCell.Top
Picture.Left = Picture.TopLeftCell.Left
Picture.TopLeftCell.EntireRow.RowHeight = Picture.Height
row = row + 1
Wend
End Sub
Column A = imagename (AL-100Y)
Column B = imagepath (c:vonnieimages)
Column C = place to insert image
Image extension can be jpg or gif
I put in column A 01
In column B C:Pictures
I can not get this to work. Can someone tell me what might be wrong? Do I need more in A and B. Thanks