ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CHANGING PRINTER DEFAULTS (https://www.excelbanter.com/excel-programming/297155-changing-printer-defaults.html)

oldjay

CHANGING PRINTER DEFAULTS
 
I HAVE THE FOLLOWING CODE TO CHANGE THE DEFAULT PRINTER
WHEN I WANT TO PRINT A PDF FILE. THIS WORKS FINE MOST OF
THE TIME BUT EVEY ONCE IN A WHILE IT HANGS BECAUSE THE PDF
PRINTER IS ON "Ne01". IF I CHANGE THE VALUE FROM Ne00 to
Ne01 THE ROUTINE WILL CONTINUE.

QUESTION: WHAT IS Ne00, Ne01, etc WHY IS IT CHANGING



CurrentPrinter = Application.ActivePrinter ' Store
current printer.
Application.ActivePrinter = "PDF995 on Ne00:" ' Change
Printers."
ActiveWindow.SelectedSheets.PrintOut ' Print the
active document.
Application.ActivePrinter = CurrentPrinter ' Set
printer back to current.
ActiveWorkbook.Close

TimOBrien

CHANGING PRINTER DEFAULTS
 
I am having the exact Question. To Change my activeprinter in need the "on NEnn". I looked at Enumprinters and do not see the "NEnn" being returned there. I am trying to create an automatically printing spreadsheet and can't affort to hard code this in the Code and have it fail. If anyone can enlighten us as to what this NEnn is and how to fiind it that would be great! Thanks!


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com