I have had some assistance with hyperlinking a filepath via a direct Cell reference in a Workbook. I am attempting to carry out the same procedure via a VLookup, but without success. Would someone be able to have a look at the code below and offer a reason it is not working.
Thank you.
VBA Code:
Dim wdDoc As Object
With CreateObject("outlook.application").createitem(0)
.To = ThisWorkbook.Worksheets("Lookups").Application.VLookup(Me.ComboBox.value, ThisWorkbook.Worksheets("Lookups").Range("D:E"), 2, False)
.Subject = "Title"
.Body = " Body text."
.sentonbehalfofname = "email address"
.display
Set wdDoc = .GetInspector.WordEditor
wdDoc.Hyperlinks.Add wdDoc.Range(0, 0), ThisWorkbook.Worksheets("Tracker").VLookup(Me.cboSelectFileReference.value, ThisWorkbook.Worksheets("Tracker").Range("C:S"), 16, False), , , Me.cboSelectFileReference.value
'.send
End With
Thank you.