Selecting a printer in an Excel 2007 Userform [Solved/Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
I am using the following code:
Private Sub CommandButton1_Click()

Application.Dialogs(xlDialogPrint).Show
UserForm1.PrintForm

End Sub

I can show all of the printers attached to my computer, but will not print to any other but the default printer. Can anyone help me?
Thanks

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
You have to set the active printer as for example

Application.ActivePrinter = "PDF995 on Ne00:"
Is this instead of:
Application.Dialogs(xlDialogPrint).Show
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
Yes. In code you are saying what printer to go to. In the example above, I am sending to PDF995

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!