Recently I wanted to change Excel’s ActivePrinter using VBA. That isn’t as straightforward as I expected it to be. In particular there is a. There’s a property of the Application object called ActivePrinter. Add a new VBA Module to workbook and paste the code below into it. Is there a way of creating a list of Active Printers on a users computer for the user to select to be used in the PrintOut method i.e. I am bypassing.
|Published (Last):||3 August 2016|
|PDF File Size:||9.11 Mb|
|ePub File Size:||18.71 Mb|
|Price:||Free* [*Free Regsitration Required]|
Glad you have everything working now. I am bypassing the Print option but some users want to print in colour so I need to be able to select other printers and pass the name to the PrintOut method Ozgrid is Not Associated With Microsoft.
In particular there is a localization issue.
Programming Excel with VBA and .NET by Steve Saunders, Jeff Webb
Add a new VBA Module to workbook and paste the code below into it. Recent comments cbd clinic products on Excel and XML: Exit Do Case Else: Once you find the printer name and it’s port you can change activepginter using the method WBD posted.
Has made maintaining a bit of code here much simpler.
Changing the active printer in a macro Hello andy, You need to include the colon “: And do that on all machines of all users? Excel not only wants to know the printer name but also the port name of the printer, which can be something like Ne01, LPT1, Nul or any IP address. Do I need to define a variable first?
excel vba alternate active printer – Stack Overflow
VBA stuff Tagged With: ActivePrinter to your default printer, in my case usually a Laserjet. You may have to register before you can post: Last edited by Leith Ross; Sep 11th, at Pearson Site Last Updated: Otherwise, it will try to print from the other connected printer.
ActivePrinter in the immediate window and got as reply: ActivePrinter End Sub And this is the function: Litle bit modify your code. Results 1 to 10 of Changing the active printer in a macro The port used is USB To give a better idea I have created a dynamic page of graphs and to print all the graphs i need to change Source Data and then print the page so I cannot do a Print Entire Workbook Cite this page as: Do I make the code line application.
So your code not such universal.
Excel on Windows