Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, Does any one have any suggestions for E-mailing attachments based on cell value? My current macro works great, however, I must enter: Attachemnts.add "file name" for the Macro to function. Currently I reference cells in the worksheet named "Mail" for the "To" "CC" and "Subject" and everyhting runs smooth. However, if I try t reference the file name to attach rather than entering the file nam directly in the code, I receive an error message. Below is the par (.Attachment) of the code that is not working. .To = ThisWorkbook.Sheets("Mail").Cells(2, a + 2).Value .CC = ThisWorkbook.Sheets("Mail").Cells(2, a + 3).Value .Subject = ThisWorkbook.Sheets("Mail").Cells(2, a + 4).Value .Attachments = ThisWorkbook.Sheets("Mail").Cells(2, a 5).Value Any suggestions would be greatly appreciate -- STEVE ----------------------------------------------------------------------- STEVEB's Profile: http://www.excelforum.com/member.php...nfo&userid=187 View this thread: http://www.excelforum.com/showthread.php?threadid=39794 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See this macro for a example
http://www.rondebruin.nl/mail/folder2/files.htm -- Regards Ron de Bruin http://www.rondebruin.nl "STEVEB" wrote in message ... Hi, Does any one have any suggestions for E-mailing attachments based on a cell value? My current macro works great, however, I must enter: Attachemnts.add "file name" for the Macro to function. Currently I reference cells in the worksheet named "Mail" for the "To", "CC" and "Subject" and everyhting runs smooth. However, if I try to reference the file name to attach rather than entering the file name directly in the code, I receive an error message. Below is the part (.Attachment) of the code that is not working. To = ThisWorkbook.Sheets("Mail").Cells(2, a + 2).Value CC = ThisWorkbook.Sheets("Mail").Cells(2, a + 3).Value Subject = ThisWorkbook.Sheets("Mail").Cells(2, a + 4).Value Attachments = ThisWorkbook.Sheets("Mail").Cells(2, a + 5).Value Any suggestions would be greatly appreciated -- STEVEB ------------------------------------------------------------------------ STEVEB's Profile: http://www.excelforum.com/member.php...fo&userid=1872 View this thread: http://www.excelforum.com/showthread...hreadid=397945 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem opening e-mail attachments | Excel Discussion (Misc queries) | |||
Sending Templates as e-mail Attachments? | Excel Discussion (Misc queries) | |||
E-mail macro - how do I attach multiple attachments? | Excel Discussion (Misc queries) | |||
send tomail recipient (as attachments) is grey'd out | Excel Discussion (Misc queries) | |||
Multiple attachments in Excel e-mail? | Excel Programming |