Hello,
The code below follows a hyperlink and attaches it to an email, problem is that if the hyperlink is a PDF file it won't attach the PDF but instead the active excel workbook which is the file that has the hyperlink!
Sub Email()
'
'
Dim wb2 As WorkBook
With OutMail
.To = EMAIL & ";" & CC & ";"
.CC = ""
.BCC = ""
.Subject = Brand & " #" & ws.Range("G9").Value
If HasHyperlink(ws.Range("D24")) Then
ws.Range("D24").Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Set wb2 = ActiveWorkbook
Windows(MainWb).Activate
.Attachments.Add wb2.FullName
End If
End Sub
Thanks in advance!
Bookmarks