+ Reply to Thread
Results 1 to 10 of 10

How to mail a range of worksheet as PDF attachment

  1. #1
    Registered User
    Join Date
    02-12-2016
    Location
    Enugu
    MS-Off Ver
    enugu
    Posts
    50

    How to mail a range of worksheet as PDF attachment

    I want to be able to mail part of a workseet as PDF. The range to be mailed as PDF is from D8:J25.
    Subject is located on A1
    "TO" is located on B1
    "CC" on C1
    Body on D1

    File name on E1.

    When I click on the Send mail button, I do not want outlook's prompt to allow email sending. In otherwords, I'd like the emai to be sent without giving the user the option to cancel it.


    Is it possible for the email to be delivered on Internet re-connection in case of network failure?
    Thanks!

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: How to mail a range of worksheet as PDF attachment

    Something like this...

    Please Login or Register  to view this content.
    Is it possible for the email to be delivered on Internet re-connection in case of network failure?
    Not to sure on this...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    02-12-2016
    Location
    Enugu
    MS-Off Ver
    enugu
    Posts
    50

    Re: How to mail a range of worksheet as PDF attachment

    Thanks @ sintek. It worked! Is it possible to modify the code to send email without outlook cause it seems to be very sluggish?

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: How to mail a range of worksheet as PDF attachment

    modify the code to send email without outlook
    What you mean...What Email provider do you want to use...

    Add
    Please Login or Register  to view this content.
    at beginning of code and
    Please Login or Register  to view this content.
    at end...Should speed up

  5. #5
    Registered User
    Join Date
    02-12-2016
    Location
    Enugu
    MS-Off Ver
    enugu
    Posts
    50

    Re: How to mail a range of worksheet as PDF attachment

    Quote Originally Posted by sintek View Post
    What you mean...What Email provider do you want to use...
    I learned that CDO is an alternative

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: How to mail a range of worksheet as PDF attachment

    See link...I have used before...very easy to adapt code...
    http://www.exceltrainingvideos.com/t...automatically/

  7. #7
    Registered User
    Join Date
    02-12-2016
    Location
    Enugu
    MS-Off Ver
    enugu
    Posts
    50

    Re: How to mail a range of worksheet as PDF attachment

    @ sintek the code returns this error: User-defined type not defined and highlights this code>> Dim myMail As CDO.Message

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: How to mail a range of worksheet as PDF attachment

    Set Reference to Microsoft CDO for Windows 2000 Library
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  9. #9
    Registered User
    Join Date
    02-12-2016
    Location
    Enugu
    MS-Off Ver
    enugu
    Posts
    50

    Re: How to mail a range of worksheet as PDF attachment

    Thanks to @ sintek and @ bakerman2. After I set the reference, the code is running smoothly

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: How to mail a range of worksheet as PDF attachment

    Glad to help and thanks for rep+.

+ 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. Send e-mail with attachment
    By alexduy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2016, 02:05 AM
  2. Macros for Mail Range/Selection in the body of the mail along with attachment
    By xenon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2015, 06:29 AM
  3. Mail Range/Selection in the body of the mail along with an attachment
    By johnny_canuck in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-27-2013, 05:52 AM
  4. Creating an e-mail with an e-mail attachment
    By Peter1245 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-25-2013, 03:42 AM
  5. code to attach the draft mail in new compose mail as attachment in outlook 2010
    By priya1987 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2012, 08:38 AM
  6. Replies: 4
    Last Post: 04-20-2006, 11:55 AM
  7. e mail attachment
    By zapatista66 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2005, 10:16 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