ACTIVEPRINTER VBA PDF

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: Yozshugami Malacage
Country: Tajikistan
Language: English (Spanish)
Genre: Technology
Published (Last): 9 July 2015
Pages: 445
PDF File Size: 7.11 Mb
ePub File Size: 11.14 Mb
ISBN: 126-7-90016-730-6
Downloads: 9741
Price: Free* [*Free Regsitration Required]
Uploader: Maudal

ActivePrinter in PrintOut Method – Free Excel\VBA Help Forum

The time now is You could just set that if you know the name of the printer: Results 1 to 10 of I am bypassing the Print option but some users want to print in colour activeprimter I need to be able to select other printers and pass the name to the PrintOut method This will get the activeprniter of availble printers.

Note that setting the ActivePrinter ‘ changes the default printer for Excel but does not change ‘ the Windows default printer. And do that on all machines of all users?

Login or Sign Up. You need to know the printer’s name and the port it uses.

  ALEX KRULIKOWSKI GD&T PDF

I ran the macro just now, and it gave a completely different port. The code here is a function named GetPrinterFullNames that reads the registry and returns a String array, where each element in the array is the name of a printer device connected to the PC.

Application.ActivePrinter property (Excel)

Do I make the code cba application. Sounds a little bit better. VBA stuff Tagged With: ActivePrinter ‘ do something with the temp printer Application. Forums Blogs Articles Groups. Changing the active printer in a macro There’s a property of the Application object called ActivePrinter. Thanks for the suggestion, it works ok on my pc, but unfortunately I am having a couple of problems. You can download the bas file with all the example code on this page.

Last edited by Leith Ross; Sep 11th, at Help Contact Us Go to top. Solved that my problem — added the line ThisWorkbook.

Changing the active printer in a macro Alright, I tried the full string, and just the printer name, and the port. If this is your first visit, be sure to check out the Board FAQ by clicking the link above. Changing the active printer in a macro Hello andy, You will need a little more information to set the ActivePrinter.

This will display a list of printers and faxes for the local computer.

Thank you Fran Bus. Exit Do Case Else: August 05, ‘ Authoer: Thread Tools Show Printable Version. Once you find the printer name and it’s port you can change it using the method WBD posted. Has made maintaining a bit of code here much simpler.

  AMELOGENESE IMPERFEITA PDF

Exit Function Do Start: Bva it is not obvious to activeprinher a list of all possible port names. 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 All times are GMT ActivePrinter End Sub And this is the function: Thanks for your help! Return to top of page.

ActivePrinter Property

Does it need a particular library? Litle bit modify your code. Is there a line I can add to the macro to select the correct printer so I can JUST activate it without having to sidetrack? Changing the active printer in a macro Probably it would be: StdRegProv” ‘ get the Devices from the registry regobj. Any ideas would be appreciated The problem I typed? Create a list of available printers using Data Validation in A1 then use this code: