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: Galmaran Negar
Country: Czech Republic
Language: English (Spanish)
Genre: Video
Published (Last): 5 March 2007
Pages: 68
PDF File Size: 7.55 Mb
ePub File Size: 17.56 Mb
ISBN: 203-4-38233-133-3
Downloads: 28436
Price: Free* [*Free Regsitration Required]
Uploader: Shajas

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.

ActivePrinter in PrintOut Method – Free Excel\VBA Help Forum

Become a Registered Member free to remove the ads that appear in thread area. The problem I typed? I have a macro that I use to change the fill color of cells, hide and unhide columns, and print 1 copy of each worksheet in the file.

Sounds a little bit activrprinter.

How to set Excel’s ActivePrinter using VBA? •

Login or Sign Up. Do I need to define a variable first? Cite this page as: I could not find any difference with my pc, where there is no such problem.


ActivePrinter to your default printer, in my case usually a Laserjet. Excel not only wants to know the printer name actibeprinter also the port name of activeprimter printer, which can be something like Ne01, LPT1, Nul or any IP address.

All contents Copyright by MrExcel Publishing.

Ozgrid is Not Associated With Microsoft. Thank you Fran Bus. Do I make the code line application.

You need to know the printer’s name and the port it uses. Unfortunately it is not obvious to create a list of all possible port names. Create a list of available printers using Data Validation in A1 then use this code: All times are GMT ActivePrinter ‘ do something with the temp printer Application.

This will get the list of availble printers. Hello andy, You need to include the colon “: The code on this page gets its list of printers from the system registry, specifically the key.


In particular there is a localization issue. Thanks for the suggestion, activperinter works ok on my pc, but unfortunately I am having a couple of problems. If this is your first visit, be sure to check out the Board FAQ by clicking the link above.


You may have to register before you can post: Just what I was looking for. You can download the bas file with all the example code on this page. Has made maintaining a bit of code here much simpler. Dialogs xlDialogPrinterSetup and ask the user to vbaa the printer.

How to set Excel’s ActivePrinter using VBA?

Changing the active printer in a macro Alright, I tried the full string, and just the printer name, and the port.

Does it need a particular library?

You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted. ActivePrinter End Sub And this is the function: