+ Reply to Thread
Results 1 to 6 of 6

Attachment + range of cells via email

  1. #1
    Registered User
    Join Date
    07-05-2015
    Location
    bridgwater
    MS-Off Ver
    2007
    Posts
    3

    Attachment + range of cells via email

    Hi I am having difficulty writing the code to send an email with the active workbook attached to it and also a range of cells from the active sheet in the body of the email. I can do one or the other but cannot seem to combine the 2. Can anyone help?

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Attachment + range of cells via email

    Hi, danjones121,

    you could have posted the code you have so far. Maybe have a look at Mail from Excel with Outlook (Windows) for some samples and be more specific on what might not suit together likje you want it.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    07-05-2015
    Location
    bridgwater
    MS-Off Ver
    2007
    Posts
    3

    Re: Attachment + range of cells via email

    Here is the code I have so far.


    Sub Send_Range()



    ActiveSheet.Range("EOD").Select (EOD is a named range)


    ActiveWorkbook.EnvelopeVisible = True


    With ActiveSheet.MailEnvelope
    .Introduction = "Good evening, please see below the End of day report."
    .Item.To = "EOD Report" (contact group)
    .Item.Subject = "End Of Day Report"
    .Item.send
    .Item.attach = ActiveWorkbook
    End With
    End Sub


    The Attach line seems to be the problem.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Attachment + range of cells via email

    Hi, danjones121,

    try reversing Send and Attach command lines. And please wrap your code with code-tags.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    07-05-2015
    Location
    bridgwater
    MS-Off Ver
    2007
    Posts
    3

    Re: Attachment + range of cells via email

    Sorry im new to all this.

    I have tried what you have said and still not working. Object does not support this method.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Attachment + range of cells via email

    Hi, danjones121,

    please have a read at Forum Rule #3 to add code-tags.

    Ciao,
    Holger

+ 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. Macro to prevent sending email (attachment) unless specific cells are populated
    By StartRunMSPaint in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-19-2013, 01:51 PM
  2. macro to email excel range without attachment
    By qzyvxk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2013, 06:47 AM
  3. Copy selected range from email attachment and paste into closed workbook
    By Lisa4legin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2013, 09:32 AM
  4. Emailing PDF, another attachment, and with range in email body
    By supcussy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2012, 10:03 PM
  5. Email Range as Attachment Using Cell Address
    By Johndrew in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2010, 06:33 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