+ Reply to Thread
Results 1 to 5 of 5

VBA Email code creates TWO windows

  1. #1
    Registered User
    Join Date
    09-16-2013
    Location
    San Francisco, California
    MS-Off Ver
    Excel 2010
    Posts
    12

    VBA Email code creates TWO windows

    Hi everyone,
    I'm trying to get my excel script to send an email with Outlook (or at least display it so the user can review before sending), and it does it perfectly!...when it's one long script. Trouble is, when I take out the email portion and reference it instead, the whole concotion creates two email windows... even when I change the .display to .send, it sends two emails.

    I've pared back the script into its bare essentials, thinking that I must have written some piece of code that was messing it up. No dice. This code still has the same problem.
    What am I doing wrong?

    Please Login or Register  to view this content.
    If you want, you can run the code for yourself. Running the top sub will open one email window, but running the bottom sub (which only references the first sub) will open two. I've tried rearranging the subs, I've tried turning the first sub into a function.

    Any ideas?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner VA USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,580

    Re: VBA Email code creates TWO windows

    I get an error when I try to run the second one. The way the second one is coded is unnecessarily complicated. If you need to have two, try this for the second one. I ran it this way and got only one window:

    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    09-16-2013
    Location
    San Francisco, California
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: VBA Email code creates TWO windows

    That works! Thank you!!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner VA USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,580

    Re: VBA Email code creates TWO windows

    If your question has been answered please mark your thread as "Solved" so that members will know that your problem is solved.

    Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

  5. #5
    Registered User
    Join Date
    09-16-2013
    Location
    San Francisco, California
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: VBA Email code creates TWO windows

    THREAD TOOLS!!
    I looked everywhere for that thread solved thing.
    Thank you again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 06-13-2013, 11:28 AM
  2. Excel macro that creates pdf files in Dropbox folders works inconsistently in Windows 8
    By KathyS_893 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2013, 12:03 AM
  3. [SOLVED] why excel creates two new worksheets instead of one using this code?
    By Vogelmann in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-18-2012, 10:13 AM
  4. [SOLVED] AutoFill code creates error
    By Lift Off in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-14-2012, 12:44 PM
  5. Help with code that creates formulas on new sheets
    By westonkw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2008, 10:41 AM

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