+ Reply to Thread
Results 1 to 13 of 13

Email on sheet from a workbook through outlook

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Email on sheet from a workbook through outlook

    I have attached a dummy file that I am working with (it is not a macro enabled workbook but I know it will need to be when this is figured out). What I would like to do is take one sheet( the active sheet ) in a workbook that I have open and mail it through outlook. I would like the subject line to be whatever is in the cell next to P.O. Number. I would like the title of the attachment to also be whatever is in the cell next to P.O. Number. I do not need the body of the email in vba. Also, I would like to display the email so that I can choose who I send it to. If anyone can help with this I would greatly appreciate it. If you need any more information please let me know.

    Thank you in advance.
    Attached Files Attached Files
    Last edited by dhes5555; 08-29-2012 at 12:24 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Email on sheet from a workbook through outlook

    Hi dhes5555

    Please look at this link...it does as you describe. If you need help adapting please let me know.
    http://www.rondebruin.nl/mail/folder2/mail2.htm
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    08-28-2012
    Location
    michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Email on sheet from a workbook through outlook

    Thanks for the response jaslake. It does the trick but I would like to make a few changes and any input would be appreciated. I would like the temporary file name to be named whatever is in cell i2. I would also like the subject line to be whatever is in cell i2.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Email on sheet from a workbook through outlook

    Hi dhes5555

    At a minimum, I'd need to see your code to help with this
    I would like the temporary file name to be named whatever is in cell i2. I would also like the subject line to be whatever is in cell i2.
    Are we still working with your attached sample file?

  5. #5
    Registered User
    Join Date
    08-28-2012
    Location
    michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Email on sheet from a workbook through outlook

    Ok, I have attached a newer version of my file with the code that I have adjusted. Everything is working except for the save as portion of it. I keep getting a run time error 1004. The save as of the workbook failed. Also, when I run the macro in the template that I have uploaded it opens up the original file that I had the code in. Thanks.

  6. #6
    Registered User
    Join Date
    08-17-2012
    Location
    Dundee
    MS-Off Ver
    Excel 2010 64 Bit
    Posts
    15

    Re: Email on sheet from a workbook through outlook

    I had pretty much the same problem a few days ago and stojko89 was kind enough to help me out in http://www.excelforum.com/excel-prog...-to-email.html

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Email on sheet from a workbook through outlook

    Hi dhes5555

    When I run your code with Sheet cnc the ACTIVE sheet AND there's a value in Cell H4 the code runs fine. It creates a file with the name of Cell H4 and the subject line is the value of H4. The only issue I have is the created file is an .xlsm file and has links.

    So, you need to explain your process and what you wish to happen...perhaps we can help.

  8. #8
    Registered User
    Join Date
    08-28-2012
    Location
    michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Email on sheet from a workbook through outlook

    Sorry about that. When I put a value in for H4 the code runs and it creates an email, the only other trouble I am having is when I copy the code from the template into my other workbooks, when I run the code it opens up the template as well. How do I stop it from doing that?

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Email on sheet from a workbook through outlook

    Hi dhes5555

    Explain your process...I'll see if I can duplicate the issue.

  10. #10
    Registered User
    Join Date
    08-28-2012
    Location
    michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Email on sheet from a workbook through outlook

    Ok, I think I have figured it out. When I tested this out in the template workbook I clicked on the office button, then excel options then customize then I added this macro to the quick access toolbar. When I put the code into the other 6 workbooks that I am using and used that quick access icon it opens up the template. How do I get it to stop doing that? Do I have to associate that macro to every individual workbook?

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Email on sheet from a workbook through outlook

    Hi dhes5555

    You can place the procedure in your Personal.xls(b) workbook then add that reference to your quick access toolbar. Check out this link.
    http://www.lytebyte.com/2008/09/09/h...in-excel-2007/

  12. #12
    Registered User
    Join Date
    08-28-2012
    Location
    michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Email on sheet from a workbook through outlook

    Awesome. So far so good. Hopefully I don't run into any problems with it in the future. Thank you so much for your help.

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Email on sheet from a workbook through outlook

    You're welcome...appreciate the Rep.

+ 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