Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Network Printer select, and tray

0

I am trying to print a sheet to a network printer that is not my default.

I want it to also select a specific tray on that printer when printing.

I have inserted a button with this code:

Private Sub Printto_Click()
   If Application.Dialogs(xlDialogPrinterSetup).Show Then
        ActiveSheet.PrintOut
    Else: End
    End If
End Sub

This was the only way I found get it to even select the printer.  Still no joy on the tray selection.

Ideas?

Thanks.

Answer
Discuss

Answers

0

You can't select the tray from a macro in Excel. Those printer settings are specific to the printer and not controlled by Excel, basically.

The only viable solution that I have seen for your issue is to setup a printer definition in Windows that uses the desired tray. Then, you will have another printer option from which to choose in the macro and that option will use the desired tray.

Also, here is a macro guide to printing that we have that might help with the basic macro setup: Printing from an Excel Macro

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login