+ Reply to Thread
Results 1 to 4 of 4

EMailing Work Sheet Trying to Attach File Listed In Cell

  1. #1
    Registered User
    Join Date
    11-14-2009
    Location
    Canton, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    2

    EMailing Work Sheet Trying to Attach File Listed In Cell

    Hello all any help will be appreciated. I am new at macros and need a little help. I am using a macro to e-mail any work sheet with an address in A1. I would also like to attach a file that will be listed in cell E1 of that worksheet. The file is different for each work sheet that is being sent but will be listed in the same cell of each work sheet.

    This is the code I am using (i got it from ron de bruin) when I use the .Attachments.Add (C:\test1.txt) it works but i can not seem to figure out how to get it to read the file address in the E1 cell. The code i am trying to use is .Attachments.Add = ws.Range("E1").value Thanks in advance for any help you offer.

    Please Login or Register  to view this content.
    Last edited by lljharris; 11-15-2009 at 12:45 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: EMailing Work Sheet Trying to Attach File Listed In Cell

    hello
    Maby somethink allong the lines of
    Please Login or Register  to view this content.


  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: EMailing Work Sheet Trying to Attach File Listed In Cell

    Hi

    I'm assuming E1 contains just the filename. In which case include the path, either hard coded as here or as a variable
    Change the line to

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    11-14-2009
    Location
    Canton, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: EMailing Work Sheet Trying to Attach File Listed In Cell

    D_Rennie YOU ROCK Thank you very much!!!!! It works great.

+ 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