|  

» Change the default printer using VBA in Microsoft Excel

VBA macro tip contributed by Erlandsen Data Consulting offering Microsoft Excel Application development, template customization, support and training solutions
This example macro shows how to print a selected document to another printer then the default printer.
This is done by changing the property Application.ActivePrinter :
Sub PrintToAnotherPrinter()
Dim STDprinter As String
    STDprinter = Application.ActivePrinter
    Application.ActivePrinter = "microsoft fax on fax:" 
    ' change printer
    ActiveSheet.PrintOut 
    ' prints the active sheet
    Application.ActivePrinter = STDprinter 
    ' change back to standard printer
End Sub


Rate This Tip
12 34 5
Rating: 3.40     Views: 57724
No comments have been submitted.
Click here to post comment
For Registered Users
Name
Comment Title
Comments