I am trying to send the form to a printer other than the default printer using: Printer = “HP LaserJet Series PCL on LPT4:”. There’s a property of the Application object called ActivePrinter. You could just You will need a little more information to set the ActivePrinter. The Printer property needs to be changed in the registry code in order to print from a different printer other than the default printer. If we need to .
|Published (Last):||3 July 2013|
|PDF File Size:||20.23 Mb|
|ePub File Size:||20.64 Mb|
|Price:||Free* [*Free Regsitration Required]|
StdRegProv” ‘ get the Devices from the registry regobj. Hello I am having trouble printing a page to both a local printer which works fine and a network printer which does not work Both printers are installed on the Computers.
ActivePrinter in the immediate window and got as reply: Thanks Paul, I would do that if I knew how to!! All three errored me out. 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? Use API functions to retrieve all your installed printers and there port names from the registry. Please use [code] tags when posting code.
Resources saved on this page: 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. Probably it would be: Recent comments cbd clinic products on Excel and XML: Promoting, selling, recruiting, coursework and thesis posting is activeprinteg. Just what I was looking for. Litle bit modify your code.
Comments Lewis Metzger says: Error in line: August 05, ‘ Authoer: Help Contact Us Go to top. Otherwise, it will try to print from the other connected printer.
Changing the active printer in a macro
Configure the printer ports in Windows. Register now while it’s still free! Last edited by RoryA; Sep 11th, at Jack in the UK. Go into the printer properties, and Add Port, or Configure Port –Paul It’s important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face You may have to register before you can post: If this is your first visit, be sure to check out the Board FAQ by clicking the link above.
Any help will be appreciated. You could just set that if you know the name of the printer: ActivePrinter ‘ do something with the temp printer Application. Forums Actoveprinter Articles Groups. I have 32 bit Windows API code that gets the device names and works well locally, but needs additional work for network printers. Dialogs xlDialogPrinterSetup and ask the user to select the printer. Become a Registered Member free to remove the ads that appear in thread area.
I’m not sure whether the assignment for net port is a static thing or variable everytime you restart the pc. I expected that this applicaation do it:. Solved that my problem — added the line ThisWorkbook.
How actvieprinter get the port of a printer? The problem I typed? This is the code to test the function: Has made maintaining a bit of code here much simpler.
How to set Excel’s ActivePrinter using VBA?
Thread Tools Show Printable Version. Any ideas how to make the printer use the same NE port number on all three machines? Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden. Close this window and log in.
Join your peers on the Internet’s largest technical computer professional community. Changing the active printer in a macro Probably it would be: Returns and array of printer names and port numbers on the user’s computer.
Return to top of page. May 22nd, 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.