Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I can't seem to figure out how to do this. I want to add a hyperlink to my
Excel Spreadsheet (2003 version) that will allow someone to click on it and it will automatically construct an email to the specified "mailto" address, attaching the spreadsheet as an attachment. Any ideas? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You may remove the hyperlink, ans format the cell in underlined blue
like a hyperlink and paste the following macro in the sheet module (it is assumed that the cell containing the mail address is A1. Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address < "$A$1" Or Target.Count < 1 Then Exit Sub Application.EnableEvents = False ActiveSheet.Cells.Copy Workbooks.Add 1 ActiveSheet.Paste ' or maybe do a paste special With ActiveWorkbook On Error Resume Next Kill "c:\temp\attachment.xls" On Error GoTo 0 .SaveAs "c:\temp\attachment.xls" .Close End With Set OlApp = CreateObject("Outlook.application") Set m = OlApp.CreateItem(olMailItem) With m .Subject = "Subject" .Body = "Body" .Recipients.Add Target.Value .attachments.Add "c:\temp\attachment.xls" .Send End With Target.Offset(, 1).Select Application.EnableEvents = True End Sub HTH Daniel I can't seem to figure out how to do this. I want to add a hyperlink to my Excel Spreadsheet (2003 version) that will allow someone to click on it and it will automatically construct an email to the specified "mailto" address, attaching the spreadsheet as an attachment. Any ideas? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Check out Ron de Bruin's site where he explains how to send mail from a range, you can use the worksheet change event and intersect method to narrow the range. 'Example Code for sending mail from Excel' (http://www.rondebruin.nl/sendmail.htm) -- The Code Cage Team Regards, The Code Cage Team http://www.thecodecage.com ------------------------------------------------------------------------ The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=29214 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
cannot use "Create List" and "Share Workbook" same time | Excel Discussion (Misc queries) | |||
=HYPERLINK("mailto: | Excel Discussion (Misc queries) | |||
Using "mailto" function in a macro | Excel Discussion (Misc queries) | |||
copy/convert column email addresses Hyperlink "mailto:" excel97 | Excel Discussion (Misc queries) |