Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Displaying the Print Dialog Box in a Macro.

Displaying the Print Dialog Box in a Macro

by Allen Wyatt
(last updated November 1, 2014)


Before printing anything in Excel, it is not unusual to display the Print dialog box. This allows you to make changes to how the print job will be handled by the printer driver.

If you are creating a macro that is used to print information from your worksheets, you may want to display the Print dialog box programmatically. The user can then choose to print, directly from within your macro.

To add this capability, simply include the following macro line:

bTemp = Application.Dialogs(xlDialogPrint).Show

The Show method results in the Print dialog box being displayed. When this code line is finished, bTemp will be either True or False. If True, it means that the user clicked on OK in the dialog box, thereby printing something. If False, then the user either clicked on Cancel or the Close button to close the dialog box without printing.

You might wonder if this approach will work in Excel 2013 seeing as the program now uses what Redmond refers to as "Backstage view" to intiate printing. (Just press Ctrl+P and you can see the printing options in Backstage view.) Fortunately, it does. Excel 2013 dutifully displays the Print dialog box as it appeared in earlier versions of the program, bypassing completely the need for what you see in Backstage view.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10321) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Displaying the Print Dialog Box in a Macro.

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. ...


Conditionally Adding a Period in a Mail Merge

When merging data into a Word document, you may want to add information to the document based on an evaluation of what is ...

Discover More

Table Borders Won't Print

Print a table and you may be surprised if it has no borders. That could be because you actually have the borders turned ...

Discover More

Making PROPER Skip Certain Words

The PROPER worksheet function is used to change the case of text so that only the first letter of each word is uppercase. ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Determining the Day of the Month

Want to figure out the day of the month represented by a particular date? You can use the Day function in VBA to get the ...

Discover More

Generating Unique Numbers for Worksheets

You may need to automatically generate unique numbers when you create new worksheets in a workbook. Here are a couple of ...

Discover More

Macro Runs Slowly, but Steps Quickly

When you have a macro that processes a huge amount of data, it can seem like it takes forever to finish up. These ...

Discover More

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

View most recent newsletter.


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 six more than 8?

2014-11-01 14:39:11

Morris Manning

If you prefer to display the Print Preview Dialog (my preference) the following code does the job.

ActiveWindow.SelectedSheets.PrintPreview 'Brings up Print Preview Dialog

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

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.