Selecting a printer in an Excel 2007 Userform

Solved/Closed
hbrewer - Apr 28, 2010 at 08:27 AM
rizvisa1
Posts
4479
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

1 reply

rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
770
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
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
770
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