+ Reply to Thread
Results 1 to 12 of 12

Send worksheet as PDF

  1. #1
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Send worksheet as PDF

    Looking for a simple vb code to save and send worksheet as PDF.

    I don't need to have the email addresses in the code but just attach the PDF worksheet
    And open outlook so can select the emails addresses.

  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: Send worksheet as PDF

    Hi, wayneao,

    please have a look at Create and Mail PDF files with Excel 2007/2013 (with option for a download of a sample workbook) and see if the article helps with your problem.

    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-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Send worksheet as PDF

    I tried with the link but it's,to complicated for me. I have just begun with excel,

    I wanted a simple way to open outlook with the attachment of the worksheet so I can select the email address.

    Because the emails are to many and different I thought it would be good if I choose the when outlook opens.

  4. #4
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Send worksheet as PDF

    This works well except the except I don't want to use the workbook name or the worksheet name in the title of the PDF attachment. Reason each month the worksheet changes it's pdf or printed name.
    How can I eliminate using the part of the code that includes the workbook and worksheet names?

    Please Login or Register  to view this content.
    Last edited by wayneao; 07-19-2014 at 07:05 AM.

  5. #5
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Send worksheet as PDF

    This works well except the except I don't want to use the workbook name or the worksheet name in the title of the PDF attachment. Reason each month the worksheet changes it's pdf or printed name.
    How can I eliminate using the part of the code that includes the workbook and worksheet names?

    Can I use a imput box to enter the name of the worksheet ?

    Please Login or Register  to view this content.
    Last edited by wayneao; 07-19-2014 at 07:04 AM.

  6. #6
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Send worksheet as PDF

    This works well except the except I don't want to use the workbook name or the worksheet name in the title of the PDF attachment. Reason each month the worksheet changes it's pdf or printed name.
    How can I eliminate using the part of the code that includes the workbook and worksheet names?

    Please Login or Register  to view this content.
    Last edited by wayneao; 07-19-2014 at 07:03 AM.

  7. #7
    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: Send worksheet as PDF

    Hi, wayneao,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger

  8. #8
    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: Send worksheet as PDF

    Hi, wayneao,

    the code line
    Please Login or Register  to view this content.
    fills the variable which holds the name for the document.

    You may try
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Ciao,
    Holger

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,610

    Re: Send worksheet as PDF

    The author suggested by HaHoBe also wrote an add-in. Very easy to install and use http://www.rondebruin.nl/win/addins/rdbmail.htm

  10. #10
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Send worksheet as PDF

    Here the code:


    Please Login or Register  to view this content.
    [/CODE]


    However nothing happened. Did I place the code in the wrong area. Also nothing was attached. Excel is all new to me. Sorry for the questions.

  11. #11
    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: Send worksheet as PDF

    Hi, wayneao,

    placing On Error Resume Next makes the code work as if no error occurred and resultimng in not getting the proper result. I should habve noted earlier on that you should not name your variable FileName which is a VBA Keyword. And to concatenate String the ampersand is used.

    Give this a try:
    Please Login or Register  to view this content.
    Ciao,
    Holger

  12. #12
    Registered User
    Join Date
    07-04-2014
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Send worksheet as PDF

    got a error message for

    .Attachments.Add strFileName

    connot find this file

+ 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. [SOLVED] cdo send send mail - getting my external .vbs script directly into a an excel worksheet
    By PieterBlan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2014, 08:10 AM
  2. Click button to send data from one worksheet to fields on another worksheet
    By Nadzy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-29-2014, 01:59 AM
  3. send each worksheet in workbook
    By 13lack13lade in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2013, 10:15 PM
  4. Send worksheet as attachment
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-31-2009, 04:33 PM
  5. [SOLVED] Send Worksheet in Email
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2005, 03:05 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