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 .
|Country:||Sao Tome and Principe|
|Published (Last):||14 January 2015|
|PDF File Size:||19.75 Mb|
|ePub File Size:||1.27 Mb|
|Price:||Free* [*Free Regsitration Required]|
The codes that I have used are Code:. Error in line: All three errored me out. Hello Andy, You’re welcome.
Results 1 to 10 of Changing the active printer in a macro Leith Ross – When you said I needed the printer name and port, I accessed the devices and printers instead of running the macro, and axtiveprinter I saw on USB, it stood to reason that that was the port. Returns and array of printer names and port numbers on the user’s computer. It’s easy to join and it’s free. I expected that this would do it:.
By joining you are opting in to receive e-mail. In particular there is a localization issue. Share it with others Like this thread? August 05, ‘ Authoer: I could not find any difference with my pc, where there is no such problem. I agreed to these rules. Red Flag This Post Please let us know here why this post is inappropriate. Thanks Paul, I would do that if I knew how to!!
Exit Do Case Else: In case you haven’t guessed, I’m quite new to VBA! Any help will be appreciated. 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.
I almost decided to hard code the string for the above mentioned languages when I realized that the solution is already there. Please post data in proper tables – I suggest this tool. Thanks very much for this!
How to set Excel’s ActivePrinter using VBA? •
Just xpplication I was looking for. You may have to register before you can post: Become a Registered Member free to remove the ads that appear in thread area. Probably it would be: ActivePrinter to your default printer, in my case usually a Laserjet.
The Tek-Tips staff will check this out and take appropriate action. E-mail subscription to new posts?
Thanks for your help! Changing the active printer in a macro The port used is USB How to get the port of a printer? I have added them for you here; please be mindful in the future. You need to know the printer’s name and the port it uses. I’m not sure whether the assignment for net port is a a;plication thing or variable everytime you restart the pc.
Forums Blogs Articles Groups.
Jack in the UK. Run the macro “ShowPrintersAndPorts”. Print “No match” Else Application.
Add a new VBA Module activeprlnter workbook and paste the code below into it. Do I make the code line application. Sounds a little bit better. Changing the active printer in a macro Hello andy, You need activeprnter include the colon “: Return to top of page.
Ozgrid is Not Associated With Microsoft. We may share certain information about our users with our advertising and analytics partners. 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 StdRegProv” ‘ get the Devices from the registry regobj.