View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
oldjay oldjay is offline
external usenet poster
 
Posts: 6
Default 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