View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PA[_2_] PA[_2_] is offline
external usenet poster
 
Posts: 15
Default Help with adding hyperlinks to images

Hi,

I have a code to add hundreds of pictures to a sheet. It works perfectly! Now I need to modify it to add a hyperlink to each picture and I cannot get it to work. Any help is appreciated! The hyperlink is the same link that contains the picture, in this script is the variable FILENAME

Line_dest = n - 1
Filename = Sheets("LISTOFLINKS").Cells(n, 15).Value
Rows(Line_dest).RowHeight = 100
ActiveSheet.Pictures.Insert(Filename).Select
Set shp = Selection.ShapeRange.Item(1)
With shp
.LockAspectRatio = msoTrue
.Width = 180
If .Height 95 Then .Height = 95
.Cut
End With
Selection.Hyperlinks.Add Anchor:=Selection.ShapeRange.Item(1), Address:=Filename

Thanks