#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Oklahoma
    Posts
    158
    Rep Power
    11

    Excel macro help


    I am writing a macro in excel that email the spreadsheet as an attachment using this code:

    Application.Dialogs(xlDialogSendMail).Show _
    arg1:="some_static_email@here", _
    arg2:="Emailing this Work Sheet"

    my question is, how can i make VB automatically send the message so the user does not have to click send? btw, this opens up an outlook window.

    Thanks,

    rkelley
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Melbourne, Australia
    Posts
    212
    Rep Power
    12
    The following should work.
    Code:
    ActiveWorkbook.SendMail recipients:="emailaddress@here.com"
    This uses the VBA SendMail client rather that the Excel dialog boxes.


    HTH
    How can I soar like an eagle when
    I'm flying with turkey's?

IMN logo majestic logo threadwatch logo seochat tools logo