+ Reply to Thread
Results 1 to 10 of 10

Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

  1. #1
    Registered User
    Join Date
    11-27-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    31

    Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    Hi, don't even know if this is possible. I need a macro that does following:
    1) PDFs a worksheet in a work book
    2) Save it as a name given in say cell A1
    3) Attach it to a email
    4) Send email to an address given in say cell A2

    Thanks in advance for your help

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,344

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    See this thread as an example:

    http://www.excelforum.com/excel-gene...k-1-macro.html


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    Try this (I copied from here and still have the same problem# 2 and just posted 10 minutes ago)


    Please Login or Register  to view this content.
    Regards,
    tt3

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    If you had excel 2007 or newer this could be easily accomplished as the newer versions have a built in PDF creator.
    Your "MS-OFF VER", shows that you have XL2003.
    XL'03 does not have a built in PDF creator and you would probably have to do something different.

    My experience has shown that with older versions, when you selected a PDF printer, the PDF printer will default to save as the Workbook name.
    You could create a macro that copies the sheet, when you have that sheet copied, then save it and then PDF it.
    If you start the macro recorder, then right click on the sheet tab and select Move or Copy>to new workbook.
    The sheet will then be in a new workbook. Save the workbook and then PDF it.
    There are codes available that will let you save a workbook according to cell value, but this cannot be done with the macro recorder.
    Follow the steps with the macro recorder, then show us the code, somebody will be able to supply revised code so that the workbook will be saved as a cell value.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,344

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    @tt3: I don't think you're helping by posting code that you don't understand and have corrupted from the original.


    Regards, tms

  6. #6
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    @tms,
    Sorry, I knew I was wrong and I tried to deleted it right after I posted but I could not delete it.

    Regards,
    tt3

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,344

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    @Dave: good call. I hadn't even noticed the profile. Just seems a lot of people wanting PDF files and hence I just offered a link to a similar thread I answered very recently.

    I use the Bullzip PDF printer as the default printer on my laptop so I don't end up trying to print stuff to a non-existent printer, especially if/when I'm testing.

    It looks as though you can amend a settings file to determine the filename without it asking. I haven't tried this (yet) but it might be worth a look.

    Cheers, TMS

  8. #8
    Registered User
    Join Date
    11-27-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    Thanks very much everyone for all your help. TMShucks link was exactly what I was looking for. Thanks

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,344

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    You're welcome. Does that mean you're not using Excel 2003?

    Regards, TMS

  10. #10
    Registered User
    Join Date
    11-27-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell

    Using Excel 2010 so it worked perfectly. Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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