+ Reply to Thread
Results 1 to 4 of 4

Email Macro pastes the table before calling the new email

  1. #1
    Registered User
    Join Date
    09-22-2015
    Location
    Eau Claire, WI
    MS-Off Ver
    2010
    Posts
    65

    Email Macro pastes the table before calling the new email

    I have a macro that is designed to send an email with built in text based off cell references. It will copy a table that has a variable range based of another macro that runs first. My problem is, when the table pastes, it pastes into the Excel Spreadsheet instead of the new instance of an outlook email. I tried to build in a time delay to give the outlook window time to open. This has helped but it still errors sometimes and pastes the table on the spreadsheet.

    Here is my code. Please help!

    Please Login or Register  to view this content.
    Thank you!

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Email Macro pastes the table before calling the new email

    Instead of Application.Wait, try using DoEvents. In theory, DoEvents should tell the program to wait until everything before it has completed running. You might also throw one in after Selection.Copy.

  3. #3
    Registered User
    Join Date
    09-22-2015
    Location
    Eau Claire, WI
    MS-Off Ver
    2010
    Posts
    65

    Re: Email Macro pastes the table before calling the new email

    Thank you! This appears to have done the trick!

  4. #4
    Registered User
    Join Date
    09-22-2015
    Location
    Eau Claire, WI
    MS-Off Ver
    2010
    Posts
    65

    Re: Email Macro pastes the table before calling the new email

    Actually, the issue was not fixed, it is still doing it. I somehow need to make the active application to be outlook before the paste happens. Any ideas?

+ 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. VBA code to send email to the people whose email address is in the Access table
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2014, 05:11 AM
  2. Replies: 2
    Last Post: 08-01-2012, 02:47 PM
  3. Excel Email Macro VBA - How to send an email once all required fields have been fille
    By wallacm2009 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2012, 10:51 AM
  4. Replies: 6
    Last Post: 12-02-2011, 02:14 PM
  5. Macro doesn't automatically resolve All email address when email is drafted
    By sonny.thind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2011, 12:58 PM
  6. Replies: 2
    Last Post: 06-17-2011, 05:59 PM
  7. Alt+Print Screen then Opens new Outlook Mail Message and Pastes into Body of Email
    By Alex Pipes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2010, 06:53 AM

Tags for this Thread

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