View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Neuraxis Neuraxis is offline
external usenet poster
 
Posts: 2
Default PrintOut Method, Set ActivePrinter with a variable

I would like to have an Excel macro print to a printer defined in a
variable so I dont have to hard code the printer name in the code.

I have been successful with the following code:
ThisWorkbook.PrintOut ActivePrinter:="Printer Name"

What I would like to do is something like:
Set PrinterNameVariable = "Printer Name"
ThisWorkbook.PrintOut ActivePrinter:=PrinterNameVariable

Any ideas?

Thanks