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

hbrewer - Apr 28, 2010 at 08:27 AM - Latest reply: rizvisa1 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen
- 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 

3 replies

rizvisa1 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen - Apr 28, 2010 at 08:32 AM
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 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen - 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