chungtinhlak
10-15-2009, 06:01 AM
I have over 50 reports that I have to print to 5 different printers every morning. I use if statement to control what printer it goes to.
I record a macro to get the code to print. However, Everyday, it give me an error saying that the activeprinter method fail. So I have to re-record a macro and paste it in again. When I re-record, the only thing i notice changing was "On Ne02:" it got change to a different port maybe "ON Ne10" or Ne08.
Is there a way around this problem?
Application.ActivePrinter = "\\Printerserver\Printername (file://Printerserver/Printername) on Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=2, ActivePrinter:= _
"\\Printerserver\Printername (file://Printerserver/Printername) on Ne02:", Collate:=True
I record a macro to get the code to print. However, Everyday, it give me an error saying that the activeprinter method fail. So I have to re-record a macro and paste it in again. When I re-record, the only thing i notice changing was "On Ne02:" it got change to a different port maybe "ON Ne10" or Ne08.
Is there a way around this problem?
Application.ActivePrinter = "\\Printerserver\Printername (file://Printerserver/Printername) on Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=2, ActivePrinter:= _
"\\Printerserver\Printername (file://Printerserver/Printername) on Ne02:", Collate:=True