mtheriault2000
Well-known Member
- Joined
- Oct 23, 2008
- Messages
- 826
Hello again
I got code that is installing a picture over a range on my sheet.
Now, I would like to add an hyperlink to the picture so if I click on it, I will be opening my Snap Picture application
Problem is every time I create or install a new picture, the name of it change so I can't install an hyperlink over a picture that I don't know the name...
Hope I'm clear
Martin
I got code that is installing a picture over a range on my sheet.
Now, I would like to add an hyperlink to the picture so if I click on it, I will be opening my Snap Picture application
Problem is every time I create or install a new picture, the name of it change so I can't install an hyperlink over a picture that I don't know the name...
Hope I'm clear
Martin
Code:
Sub test2()
Dim MyDocument As Variant
Dim MyShape As Variant
Dim SelectImage As String
Dim TopLeft_ As Range
Dim TopRight_ As Range
Dim DownLeft_ As Range
Dim DownRight_ As Range
SelectImage = "File://G:\SnapVault\20140119_03_33_09.jpg"
Set MyDocument = Worksheets("OrderInfo")
Set TopLeft_ = MyDocument.Range("TopLeft")
Set TopRight_ = MyDocument.Range("TopRight")
Set DownLeft_ = MyDocument.Range("DownLeft")
Set DownRight_ = MyDocument.Range("DownRight")
'MyDocument.Pictures.Insert (SelectImage)
MyDocument.Select
With ActiveSheet.Pictures.Insert(SelectImage)
' .Top = Range("B4").Top
' .Left = Range("B4").Left
' .Height = Range("B10").Top - Range("B4").Top
' .Width = Range("H4").Left - Range("B4").Left
.Left = TopLeft_.Left
.Top = TopRight_.Top
.Height = TopLeft_.Top - DownLeft_.Top
.Width = DownRight_.Left - DownLeft_.Left
End With
' MyDocument.SelectImage.Hyperlinks.Add Anchor:=SelectImage
End Sub