+ Reply to Thread
Results 1 to 4 of 4

Print to PDF via vba button Excel 2007? (PLEASE CLOSE, POSTED IN WRONG SECTION)

  1. #1
    Registered User
    Join Date
    08-20-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2007
    Posts
    30

    Print to PDF via vba button Excel 2007? (PLEASE CLOSE, POSTED IN WRONG SECTION)

    Hi,

    I have the following code to print a certain cell range from a button on my worksheet,

    Please Login or Register  to view this content.
    I would like to add another button that generates a PDF file rather than print to paper, this way the pdf can be emailed.

    Thanks

    Tony
    Last edited by tailz; 08-22-2013 at 09:27 AM.

  2. #2
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Print to PDF via vba button Excel 2007?

    1. Your code needs to be inside code tags in the future, according to forum rules.

    2. I'd use the same code as a base, but instead of printing, choose to Save As > PDF. If you have trouble writing this portion of the code, try recording the macro of saving in that manner to help. Then just add a second button.
    <--- If you like the answer, press *.

  3. #3
    Registered User
    Join Date
    08-20-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Print to PDF via vba button Excel 2007?

    I now have the code as per below, which I cobbled together from various sources, however, it automatically creates the PDF named "system3", I would like it to be saved as PDF but have the "Save As" dialogue box appear so that I can manually choose the file name but still have it save as PDF. Any help would be appreciated.

    Please Login or Register  to view this content.
    Thanks

    Tony

  4. #4
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: Print to PDF via vba button Excel 2007?

    Can't you just enter the name you want in a cell and have the Filename: retrieve it from the cell?

+ 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. Print formatting help excel 2007
    By submarine in forum Excel General
    Replies: 2
    Last Post: 04-20-2013, 02:15 AM
  2. Won't print jpg in excel 2007
    By richystab in forum Excel General
    Replies: 0
    Last Post: 02-02-2011, 03:30 AM
  3. How to add a button in excel 2007
    By djkahc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2009, 10:47 PM
  4. How to add a button in excel 2007
    By djkahc in forum Excel General
    Replies: 1
    Last Post: 06-19-2009, 08:13 PM
  5. Print a Table in Excel 2007
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 11-19-2007, 12:11 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