Selecting a printer in an Excel 2007 Userform

Solved/Closed
hbrewer - Apr 28, 2010 at 08:27 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Apr 28, 2010 at 09:21 AM
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
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Apr 28, 2010 at 08:32 AM
You have to set the active printer as for example

Application.ActivePrinter = "PDF995 on Ne00:"
0
Is this instead of:
Application.Dialogs(xlDialogPrint).Show
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Apr 28, 2010 at 09:21 AM
Yes. In code you are saying what printer to go to. In the example above, I am sending to PDF995
0