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

- - Latest reply: rizvisa1
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
- 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
See more 

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
0
Thank you
You have to set the active printer as for example

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