Easily Printing to PDF

by Allen Wyatt
(last updated September 10, 2016)

2

Brian is preparing a workbook that will be used by people without extensive Excel experience. He would like a way to be able to have them print to a PDF file with ease, perhaps with the click of a button. He has no control over what version of Excel or what operating system the people have, but he wonders if there is a way to accomplish this type of output.

Printing to PDF is relatively easy if your users are using Windows 10, as it includes (finally!) a native PDF printer driver. Unfortunately, Brian indicates that he has no control over what operating system his users have, which means he can't assume that they have the native PDF output capabilities introduced in Windows 10.

Fortunately, Excel has included (since at least Excel 2007) a way to export to a PDF file. All you need to do is choose Save As (easiest way is to press F12) and then, using the Save As Type drop-down list, choose PDF. The output is saved, automatically, in a PDF file.

If you prefer a single-button approach, you could instruct your users to add a rather esoteric tool to the Quick Access Toolbar:

  1. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 and later versions, display the File tab of the ribbon and then click Options.)
  2. At the left side of the dialog box click Customize (Excel 2007) or Quick Access Toolbar (Excel 2010 or later versions). (See Figure 1.)
  3. Figure 1. The Quick Access Toolbar area of the Excel Options dialog box.

  4. Use the Choose Commands From drop-down list to choose All Commands.
  5. In the list of commands, choose Publish as PDF or XPS.
  6. Click the Add button. The command is copied to the right side of the screen.
  7. Click OK.

This new tool, when clicked, displays a dialog box that looks very similar to the Save As dialog box, except the settings are all correct for "publishing" as a PDF file.

You could also create a macro that performs the same publishing task. The macro is a good approach if you want complete control over what is included in the PDF file that is created.

Sub ExportPDF()
    Dim sFile As String

    sFile = Application.DefaultFilePath & "\" & _
      ActiveWorkbook.Name & ".pdf"

    Sheets("Sheet1").Select
    ActiveSheet.PageSetup.PrintArea = "D6:K57"
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
      Filename:= sFile, Quality:=xlQualityStandard, _
      IncludeDocProperties:=True, IgnorePrintAreas:=False, _
      OpenAfterPublish:= True
End Sub

The macro puts together a filename into the sFile variable; you should change this as desired. The macro then specifies a print area of what should be included in the PDF file. In this case, it is the range D6:K57 on Sheet1. You'll obviously want to change this to meet your needs of what you want included.

If you decide to go the macro route, you could add a button to your workbook to run the macro, making it easy for your users to create the PDF output you need.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13467) applies to Microsoft Excel 2007, 2010, 2013, and 2016.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Inserting a Copyright Mark

One of the most common symbols that can be added to a document is the copyright mark. This tip examines several ways you can ...

Discover More

Automatically Converting to GMT

You know what time it is, right? (Quick—look at your watch.) What if you want to know what time it is in Greenwich, ...

Discover More

Printing the Navigation Pane

The Navigation pane can be a handy tool for seeing the overall organization of your document and easily moving to whatever ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Conditional Printing

If you need to make what Excel prints be based upon conditions in a worksheet, you'll love the information in this tip. There ...

Discover More

Massive Printouts

Have you ever wanted to do a simple printout, only to find that Excel spit out dozens of pages, and most of them were blank? ...

Discover More

Repeating Rows on a Printout Except On the Last Page

When setting up a worksheet for printing, you can specify that Excel repeat some of your rows at the top of each page ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 4?

2017-11-16 12:48:16

Eric Hassler

I am getting asked to push the Quick Access PDF button to all users. Is there an applicable GPO that I can use? If not could a push a registry key?


2016-09-14 18:31:44

James Avoli

May I suggest an incredible piece of freeware (or an optional pay-version with additional features) that works as a printer driver? It's "PDF reDirect" from www.exp-systems.com.

It installs as a printer for use by ALL programs, not just excel. I've not had a single problem with it since I installed it as way back in WinXP. Try it yourself then recommend it in your next newsletter (which is excel-lent IMHO).
Regards,
Jim


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.