View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default send attachment using file path from hyperlink

Try this (untested)

.Attachments.Add HyperlinkAddress(Cells(1, 2))


Function HyperlinkAddress(cell)
'David McRitchie
On Error Resume Next
HyperlinkAddress = cell.Hyperlinks(1).Address
If HyperlinkAddress = 0 Then HyperlinkAddress = ""
End Function

Sub TEST()
MsgBox HyperlinkAddress(Cells(1, 2))
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Steve" wrote in message ...
Hi,


I have some code that send an email attachment like

.Attachments.Add ("Path/filename")

instead I would like to use a hyperlink to get the text
string from, like

.Attachments.Add Cells(1, 2)

(which of course doesn't work)

where B1 would have a hyperlink with the path and
filename.

So I would like replace the ("Path/filename")
with the text string of the hyperlink in B1


Thanks,

Steve