View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
STEVEB STEVEB is offline
external usenet poster
 
Posts: 1
Default E-mail Attachments


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