Macro to change Printers is very slow -- Why?

G

Gray M. Strickland

I have a macro which changes printers:

Sub ChangeToBondPaper_ON_LEXMARK_WKRM()
ActivePrinter = "\\bambam\Lexmark Optra S 1855 (MS) Workroom"
End Sub

I can manually change the printer selection in about 2 seconds, but this
macro takes about 10-12 seconds to run. Why? What about changing the
ActivePrinter is so slow when done through VBA? How can I speed things up?
 
P

Peter Hewett

Hi Gray M. Strickland

I don't know the answer to your question, I use this method (setting the active printer)
on a system with over 60 print queues defined and it not slow. It could be the
"\\\\bambam\" part, have you tried specifying just the printer name if possible?

If the above's no go there may be a work around, try using the method in the following
article:

Changing the selected (current) printer in Word without changing the system default
printer
http://www.word.mvps.org/faqs/macrosvba/ChangeCurPrinter.htm

HTH + Cheers - Peter
 
G

Gray M. Strickland

Thanks. That did the trick. For the benefit of others reading this thread:

http://www.word.mvps.org/faqs/macrosvba/ChangeCurPrinter.htm
With Dialogs(wdDialogFilePrintSetup)
.Printer = "HP DeskJet 670C Series v11.0 on LPT2:"
.DoNotSetAsSysDefault = True
.Execute
End With

works instantly (or it seems), wheras my code is slow as molases. The
difference is that the above switches the printer for Word only, but my code
switched it for the entire operating system.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top