+ Reply to Thread
Results 1 to 6 of 6

Mail Envelope Macro keeps attachment from previous mail envelope macro

  1. #1
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Mail Envelope Macro keeps attachment from previous mail envelope macro

    I have a project with multiple different sheets where each sheet has a command button to send the sheet contents through an email automatically. One sheet, my macro adds an attachement to mail envelope, but if I were to go to a different sheet and send an email via mail envelope where there shouldn't be an attachement, the previous attachement from the complete different sheet is still attached. Am I missing something from my macro that removes this attachement after sending? Any thoughts on how I can resolve if not?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,420

    Re: Mail Envelope Macro keeps attachment from previous mail envelope macro

    .
    Your macro continues to reference :

    Please Login or Register  to view this content.
    without consideration of which worksheet you are viewing/emailing.

    You will need to adjust your macro accordingly to reference the attachment ONLY if
    you are viewing/emailing Worksheets("Sample")

  3. #3
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Mail Envelope Macro keeps attachment from previous mail envelope macro

    This is the macro with the attachement for one sheet. I have a different but very similar macro for another sheet and that macro does not have the attachement line, but still includes the attachment AFTER the attachement macro is ran from the first sheet that isnt active. The non-attachment envelope macros work as intended as long as the attachement macro has not been ran beforehand.

    Different macros are assigned to command buttons on the active sheet someone will be viewing. It doesnt appear this is a reference issue, but possibly a clearing envelope issue that I seem to be missing from the attachement macro. Additionally, I did what you suggested and the attachement is still there no matter the reference.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,420

    Re: Mail Envelope Macro keeps attachment from previous mail envelope macro

    This resource discusses an identical issue. You can view the webpage by using Chrome's language translator.

    The solution focuses on a few lines of code similar to :

    Please Login or Register  to view this content.

    https://www.excel-downloads.com/thre...76/#post180499


    Another resource :

    https://www.experts-exchange.com/que...-with-VBA.html

  5. #5
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Mail Envelope Macro keeps attachment from previous mail envelope macro

    You're the best for finding that for me. Thank you so much, it works!

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,420

    Re: Mail Envelope Macro keeps attachment from previous mail envelope macro

    .
    You are welcome. Let us know how it works out.

+ 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. Removing attachments from Mail Envelope
    By jennis7242 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2020, 11:41 AM
  2. .send not working via mail envelope
    By igoodable in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2019, 01:45 PM
  3. Macro to insert one or more files after searching to mail as attachment
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2014, 07:09 AM
  4. Macro for sending mail with attachment
    By shaifudheen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-06-2013, 04:55 AM
  5. Macro - Attachment to e-mail using hyperlink
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2013, 03:52 PM
  6. Macro to create an e-mail using an Outlook Template and add an attachment
    By hsarro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2012, 12:25 PM
  7. Issue with VBA e-mail attachment re-naming macro
    By rtnlsltn in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 09-04-2012, 12:19 PM

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