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.

Author: Gumi Tojat
Country: Tunisia
Language: English (Spanish)
Genre: Sex
Published (Last): 17 May 2013
Pages: 474
PDF File Size: 10.83 Mb
ePub File Size: 20.47 Mb
ISBN: 575-5-62698-593-2
Downloads: 55905
Price: Free* [*Free Regsitration Required]
Uploader: Dougrel

And do that on all machines of all users?

Option Explicit ””””””””””””””””””””””””””””””””’ ‘ modListPrinters ‘ By Chip Pearson, chip cpearson. Essential Tools For Developers. Changing the active printer in a macro Actibeprinter andy, You will need a little more information to set the ActivePrinter. The code on this page gets its list of printers from the system registry, specifically the key. Become a Registered Member free to remove the ads that appear in thread area.

Use API functions to retrieve all your installed printers and there port names from the registry. Activeprinter in Word en Powerpoint.


How to set Excel’s ActivePrinter using VBA? •

Returns and array of printer names and port numbers on the user’s computer. Litle bit modify your code. At startup Excel will set Application.

Changing the active printer in a macro Hello andy, You need to include the colon “: Changing the active printer in a macro Hello Andy, You’re welcome. We may share certain information about our users with our advertising and analytics partners.

Pearson Software Consulting www. Member List Calendar Forum Rules. Last edited by Leith Ross; Sep 11th, at We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity.

How to set Excel’s ActivePrinter using VBA?

I have 32 bit Windows API code that gets the device names and works well locally, but needs additional work for network printers.

Exit Do Case Else: Any ideas would be appreciated Login or Sign Up. ActivePrinter ‘ do something with the temp printer Application. You can then loop through the list with code like:.

Thanks very much for this! Excel not only wants to know the printer name but also the port name of activeprintsr printer, which can be something like Ne01, LPT1, Nul or any IP address.


Application.ActivePrinter property (Excel)

E-mail subscription to new posts? Thanks for your help! Pearson Site Last Updated: Results 1 to 10 of Changing the active printer in a macro.

Dialogs xlDialogPrinterSetup and ask the user to select the printer. Changing the active printer in a macro Probably it would be: StdRegProv” ‘ get the Devices from the registry regobj.

It does not change the default printer activeprijter Windows. Aciveprinter 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 Help Contact Us Go to top.

ActivePrinter Property | Microsoft Docs

This page last updated: Please use [code] tags when posting code. You need to know the printer’s name and the port it uses. ActivePrinter End Sub And this is the function: May 26th, Resources saved on this page:

Author: admin