• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Control printer in macro with excel 2010

Michael67

New Member
I would like to run a macro that prints to a printer that is not default. When I record the macro and change printers, nothing shows up in the macro.

Thanks.
 
Something like ...

Code:
Dim Q As Variant, myprinter As Variant, myp As String
myp = Application.ActivePrinter
Q = MsgBox("Your Active Printer is ~ " & Left(Application.ActivePrinter, InStr(myp, " on")) & _
            vbNewLine & "Hope! You don't wish to change it.", vbInformation + vbYesNo, "Printer")
    If Q <> vbNo Then
        Exit Sub
    Else
        myprinter = Application.Dialogs(xlDialogPrinterSetup).Show
        myp = Application.ActivePrinter
            If myprinter <> False Then MsgBox "Now, Active printer is ~ " & _
                    Left(Application.ActivePrinter, InStr(myp, " on")), vbInformation, "New Printer"
    End If

or share your workbook & we will arrange a workaround.
 
Back
Top