printer macro

somersault

Board Regular
Joined
Jun 24, 2008
Messages
59
Hi,

I got this code from one of your threads.
application.Dialogs(xlDialogPrinterSetup).Show

I am trying to use this code but don't know how to use the OK, Cancel & Set-up buttons selection after this.

Could anyone pls guide me?

Thanks in advance
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Something like this

Code:
Sub TestPrint()
Dim bResponse As Boolean
bResponse = Application.Dialogs(xlDialogPrinterSetup).Show
If bResponse = False Then
    MsgBox "User cancelled"
    Exit Sub
End If
ActiveSheet.PrintOut
End Sub
 
Upvote 0
Something like this

Code:
Sub TestPrint()
Dim bResponse As Boolean
bResponse = Application.Dialogs(xlDialogPrinterSetup).Show
If bResponse = False Then
    MsgBox "User cancelled"
    Exit Sub
End If
ActiveSheet.PrintOut
End Sub


This is fantastic.. Thank you..
One more question : Do I need to put a VBA code for setting options changed while the printer dialog box is open? Will default excel save this for me? (Case: i wanted to compel users only to take back to back (2sided prints))
 
Upvote 0

Forum statistics

Threads
1,214,518
Messages
6,119,985
Members
448,935
Latest member
ijat

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