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):||15 October 2005|
|PDF File Size:||19.20 Mb|
|ePub File Size:||5.83 Mb|
|Price:||Free* [*Free Regsitration Required]|
ActivePrinter Property | Microsoft Docs
I am bypassing the Print option but some users want to print in colour so I need to be able to activeprknter other printers and pass the name to the PrintOut method Become a Registered Member free to remove the ads that appear in thread area.
E-mail subscription to new posts? The problem I typed? ActivePrinter ‘ do something with the temp printer Application. Last edited by Leith Ross; Sep 11th, at Return to top of page.
This page last updated: And do that on all machines of all users?
All three errored me out. If this is your first visit, be sure to check out the Board FAQ by clicking the link above. Comments Lewis Metzger says: Hello Andy, You’re welcome.
Activeprinter in Word en Powerpoint. Probably it would be: Do I need to define a variable first? You can then loop through the list with activepritner like:.
To start viewing messages, select the forum that you want to visit from the selection below. Option Explicit ””””””””””””””””””””””””””””””””’ ‘ modListPrinters ‘ By Chip Pearson, chip cpearson. Use API functions to retrieve all your installed printers and there port names from the registry.
Exit Do Case Else: Please use the RSS Posts button above or click here. Exit Function Do Start: I could not activeprihter any difference with my pc, where there is no such problem. Changing the active printer in a macro Leith Ross – When you said I needed the printer name and port, I accessed the devices and printers instead of running the macro, and when I saw on USB, it stood to reason that that was the port.
Add a new VBA Module to workbook and paste the code below into it. It does not change the default printer in Windows.
Application.ActivePrinter property (Excel)
Otherwise, it will try to print from the other connected printer. Help Contact Us Go to top. Cite this page as: Pearson Site Last Updated: You can vbx this list to allow the user to select a printer from your application.