jimmywanna
Board Regular
- Joined
- Mar 18, 2002
- Messages
- 182
Hello my peers,
I wondered if anyone could help me with a probelem. I have a selection of workbooks which print worksheets and labels for chemotherapy drugs. I have made a macro that prints to two different printers, here it is:
Sub LABELPRINT()
' BOTH Macro
' Macro recorded 20/04/2006 by default user
Sheets("LAYOUT").Select
Application.ActivePrinter = "Eltron TLP2742 on LPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Eltron TLP2742 on LPT1:", Collate:=True
Sheets("Sheet3 (2)").Select
Application.ActivePrinter = "HP LaserJet 2200 Series PCL on Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"HP LaserJet 2200 Series PCL on Ne02:", Collate:=True
ActiveWorkbook.Close SaveChanges:=False
End Sub
It has worked well for years, but for some reason The "name" of the printer is changing periodically. Last week the section : Application.ActivePrinter = "HP LaserJet 2200 Series PCL on Ne02:" worked with the name Application.ActivePrinter = "HP LaserJet 2200 Series PCL on Ne00".
Firstly would anyone know why this would happen, secondly is there any way i can change the macro so that it finds the name of the printer first, then tells the sheet to print out on it.
Currently I am having to change it manually on around 70 workbooks.
Thank you in advance for any help.
Jamie
I wondered if anyone could help me with a probelem. I have a selection of workbooks which print worksheets and labels for chemotherapy drugs. I have made a macro that prints to two different printers, here it is:
Sub LABELPRINT()
' BOTH Macro
' Macro recorded 20/04/2006 by default user
Sheets("LAYOUT").Select
Application.ActivePrinter = "Eltron TLP2742 on LPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Eltron TLP2742 on LPT1:", Collate:=True
Sheets("Sheet3 (2)").Select
Application.ActivePrinter = "HP LaserJet 2200 Series PCL on Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"HP LaserJet 2200 Series PCL on Ne02:", Collate:=True
ActiveWorkbook.Close SaveChanges:=False
End Sub
It has worked well for years, but for some reason The "name" of the printer is changing periodically. Last week the section : Application.ActivePrinter = "HP LaserJet 2200 Series PCL on Ne02:" worked with the name Application.ActivePrinter = "HP LaserJet 2200 Series PCL on Ne00".
Firstly would anyone know why this would happen, secondly is there any way i can change the macro so that it finds the name of the printer first, then tells the sheet to print out on it.
Currently I am having to change it manually on around 70 workbooks.
Thank you in advance for any help.
Jamie