+ Reply to Thread
Results 1 to 3 of 3

E-mail Attachments

  1. #1
    Forum Contributor
    Join Date
    10-23-2003
    Posts
    141

    E-mail Attachments

    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

  2. #2
    Ron de Bruin
    Guest

    Re: E-mail Attachments

    See this macro for a example
    http://www.rondebruin.nl/mail/folder2/files.htm

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "STEVEB" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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
    >




  3. #3
    Forum Contributor
    Join Date
    10-23-2003
    Posts
    141
    Thanks Ron,

    Everything worked great!!! I really appreciate your help!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1