VBA for "PrintPreview&Print" in Excel 2010

SMB Cooper

Board Regular
Joined
Sep 10, 2008
Messages
66
VBA for "PrintPreview&Print" in Excel 2010

The Excel2010 shortut key CTRL+F2 displays the Print Preview window. How could I do this in VBA?
Print-Preview-2-300x208.png
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Thank you very much for the prompt reply... unfortunately, the code returns this... (please refer to image below)

28w1541.png


AFAIK, the "PrintPreview&Print" feature was only introduced in Excel 2010, so the said UserInterface (as shown in my first post) is really "NEW"???

Googling my way on this issue, I found out that Ctrl+P also displays the NEW Print Preview window.
 
Upvote 0
Oh, you're talking about the "Backstage" view.

I don't know if VBA can access that particular functionality (at least recording a macro indicates that it's not immediately available), which makes me think you might need to access some of the Ribbon's XML properties. It's never occurred to me to mess with that particular property, so I've never tried, but I'm sure that someone can come along and correct me on it. :)

Ron DeBruin has a good write-up on the Backstage view here: http://www.rondebruin.nl/backstage.htm

Sorry I couldn't answer the question for you.
 
Upvote 0
To whom this may concern:<o:p></o:p>
<o:p></o:p>
… so after more than 1 year, I tried to check google if the information is now available on theinternet…. this time I used the searchtags “open the backstage print preview in Excel 2010 with VBA” … lo and behold.. it is now available… and the code is…<o:p></o:p><o:p></o:p>
<o:p></o:p>
Application.CommandBars.ExecuteMso("PrintPreviewAndPrint")<o:p></o:p>


… so after more than 1 year, I tried to check google if the information is now available on the internet…. this time I used the search tags “open the backstage print preview in Excel 2010 with VBA”
… lo and behold.. it is now available… and the code is…

Application.CommandBars.ExecuteMso ("PrintPreviewAndPrint")
 
Upvote 0
To whom this may concern:<o:p></o:p>
<o:p></o:p>
… so after more than 1 year, I tried to check google if the information is now available on the internet…. this time I used the search tags “open the backstage print preview in Excel 2010 with VBA”
… lo and behold.. it is now available… and the code is…

Application.CommandBars.ExecuteMso ("PrintPreviewAndPrint")

I also tried this, and it worked for me:
SendKeys "%FP%", True
' = same as pressing in turn the keys Alt, F, P, Alt (to turn back off the little letter labels that appear after the first press of Alt)
 
Upvote 0

Forum statistics

Threads
1,224,532
Messages
6,179,388
Members
452,908
Latest member
MTDelphis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top