ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print Macro (https://www.excelbanter.com/excel-programming/425428-print-macro.html)

Mike B

Print Macro
 
I am trying to make a print macro that will automatically print in landscape
mode. This macro will be specific to one sheet only. I have tried this

Sub printactivepage()
Application.Dialogs(xlDialogPageSetup).Show
End Sub

and the options show fine, but when I click OK it will not print. Also, I do
not want any kind of option box to show, only to go strait to print in
landscape. Please note that I am very new to VBA and macros so any help would
be greatly appreciated. Thank you!

JLGWhiz

Print Macro
 
You will have to use the PrintOut command to get it to print. It will not
print from the dialog box when called from code. This is by design from
Microsoft.

"Mike B" wrote:

I am trying to make a print macro that will automatically print in landscape
mode. This macro will be specific to one sheet only. I have tried this

Sub printactivepage()
Application.Dialogs(xlDialogPageSetup).Show
End Sub

and the options show fine, but when I click OK it will not print. Also, I do
not want any kind of option box to show, only to go strait to print in
landscape. Please note that I am very new to VBA and macros so any help would
be greatly appreciated. Thank you!



All times are GMT +1. The time now is 03:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com