+ Reply to Thread
Results 1 to 5 of 5

VBA Excel Userform Sending Email

  1. #1
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    VBA Excel Userform Sending Email

    I guess I already did this wrong on my frist time post....I do hope this post is better....

    Hello all! I'm working with an excel file, a userform and a command button. The command button is the main question here. Bascally when this button is clicked and email is sent to a specific person, me. This email also contains an attachment, and currently that is the active workbook open behind the userform. This works well, sort of. I sent this excel file to 5 co-workers to test. All but 1 worked OK. One, however, did not.

    When the button was selected the standard Outlook message came up: "...an automated email is being sent on your behalf...select YES to continue..."...It all looks fine, but nothing happens...nothing shows up in their sent items folder and I do not receive this message.

    Has anyone experienced this before? Is there a sitting with this users Outlook that prohibits the sending of automatic emails? Any ideas? I've added my command button code below...incase someone sees thing strange...(I am rather new to vba coding...)

    Please Login or Register  to view this content.
    Last edited by Ironman; 01-22-2009 at 05:50 PM. Reason: I switched from .send to .display in the code...works fine

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Is the affected email address correct?

    How ar you actally inptting the email address into the code? In the example yo have posted it is hard coded, you must have some way to change this within the code.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Youv'e marked this thread solved, what was the solution?

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Ironman,

    You need to set the ShowModal property of the UserForm to False. A modal form disables the thread it is attached to. This prevents Outlook from sending the email because it is part of the same thread as the UserForm.

    Sincerely,
    Leith Ross

  5. #5
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: VBA Excel Userform Sending Email

    Hey all - - I'm going through some of my posts. I set this to solved (perhaps in error) because I elected to change the .send attribute to .display. This did the trick, I assume by allowing the user to be in more control of the sending of the email, thus Outlook Security plays a lesser role. Again, I'm making some assumtions. This auto email is a once a year kind of thing - to have this be .display is not a big deal...for my needs anyway. If I need to recode this other than solved, let me know I'd be happy to change it.

+ 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