Results 1 to 5 of 5

Thread: Excel "Save_Send" Macro

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Location
    Houston, TX
    Posts
    3

    Question Excel "Save_Send" Macro

    I've a VB macro linked to a graphic in a spreadsheet that currently has the following attached to it.

    Sub Save_Send()
    '
    ' Save_Send Macro
    ' Saves this form and attaches it to an email.
    '
    ' The question is "How do I code it so that it
    ' populates the 'To:" address and the Subject line?".
    '
    ActiveWorkbook.Save
    Application.Dialogs(xlDialogSendMail).Show
    End Sub

    This works well to create an email with the saved spreadsheet attached. Since this spreadsheet will always be sent to the same email address is there a way to code a static address (and maybe a static subject line) into the resulting email?

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Excel "Save_Send" Macro

    You don't need to show the dialog, you can just send the workbook.
    VB Code:
    1. Sub Save_Send()
    2.     ActiveWorkbook.Save
    3.     ActiveWorkbook.SendMail Recipients:="[email protected]", Subject:="This is your subject"
    4. End Sub
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Location
    Houston, TX
    Posts
    3

    Re: Excel "Save_Send" Macro

    Man...THANKS!

    I tried getting assistance from some VB guys here at work and they moaned and groaned about how hard it would be. Now I know they just didn't want to help out. Thanks again, I really appreciate it.

  4. #4
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Excel "Save_Send" Macro

    Not a problem, just glad to help.

    BTW welcome to the Forums
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Location
    Houston, TX
    Posts
    3

    Smile Re: Excel "Save_Send" Macro

    Thanks for the 'welcome'. As you might have guessed my VB experience doesn't even make me a newbie. I'm attempting to talk my employer into some formal traning in VB, Jscript, ASP, HTML and XML. I think I've finally found someone who's willing to approve it. It's only been about 3 years of pleading. Wish me luck.

Posting Permissions

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



Click Here to Expand Forum to Full Width