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):||7 January 2016|
|PDF File Size:||16.72 Mb|
|ePub File Size:||14.73 Mb|
|Price:||Free* [*Free Regsitration Required]|
I almost decided to hard code the string for the above mentioned languages when I realized that the solution is already there.
Run the macro “ShowPrintersAndPorts”. Return to top of page. Thanks for your help! All contents Copyright by MrExcel Publishing.
Programming Excel with VBA and .NET by Steve Saunders, Jeff Webb
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. Solved that my activepringer — added the line ThisWorkbook. Changing the active printer in a macro. Click Here to join Tek-Tips and talk with other members!
Network Printer Does the Ne In particular there is a localization issue. This is the code to test the function: Returns and array of printer names and port numbers on the user’s computer.
Network Printer ‘ActivePrinter’ of object’_Application’ failed – Free Excel\VBA Help Forum
Probably it would be: Any ideas how to make the printer use the same NE port number on all three machines? Please use [code] tags when posting code. ActivePrinter to your default printer, in my case usually a Laserjet. Ozgrid is Not Associated With Microsoft. So your code not such universal. Member List Calendar Forum Rules. Results 1 to 10 of VBA stuff Tagged With: Red Flag This Post Please let us know here why this post is inappropriate.
Students Click Here Join Us! Hello andy, You need to include the colon “: Network Printer Thanks shg Changing the active printer in a macro Hello andy, You will need a little more information to set the ActivePrinter. Your code is simply brilliant. May 22nd, We may share certain information about our users with our advertising and analytics partners.
Last edited by shg ; May 18th, Help Contact Us Go to top. In case you haven’t guessed, I’m quite new to VBA! I agreed to these rules.
Resources saved on this page: Sounds a little bit better.
Close this window and log in. Register now while it’s still free! To start viewing messages, select the forum that you want to visit from the selection below. I expected that this would do it: Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Do I need to define a variable first? Thread Tools Show Printable Version. ActivePrinter ‘ do something with the temp printer Application. The Tek-Tips staff will check this out and take appropriate action. StdRegProv” ‘ get the Devices from the registry regobj. I could not find any difference with my pc, where there is no such problem. Exit Function Do Start: Replacing USB with that solved the issue. August 05, ‘ Authoer: Is there a line I can add to the macro to activrprinter the correct printer so I can JUST activate it without having to sidetrack?
Thanks Paul, I would do that activepriinter I knew how to!!