itjohan73
08-07-2019, 04:28 AM
I use this script to direct the print to another printer.
it's not working the first time, but when I press print again then it works.
anyone got a clue why it's not working the first time?
Dim setDefaultPrinter()
oldprinter = Application.ActivePrinter
For i = 0 To 35
curNePrint = Format(i, "00")
On Error Resume Next
Application.ActivePrinter = "newprinter på Ne" & curNePrint & ":"
Next i
ActiveWindow.SelectedSheets.PrintOut Copies:=iAntalKopior, Collate:=False, _
IgnorePrintAreas:=False
Application.EnableEvents = True
Application.EnableEvents = False
Application.ActivePrinter = oldprinter
it's not working the first time, but when I press print again then it works.
anyone got a clue why it's not working the first time?
Dim setDefaultPrinter()
oldprinter = Application.ActivePrinter
For i = 0 To 35
curNePrint = Format(i, "00")
On Error Resume Next
Application.ActivePrinter = "newprinter på Ne" & curNePrint & ":"
Next i
ActiveWindow.SelectedSheets.PrintOut Copies:=iAntalKopior, Collate:=False, _
IgnorePrintAreas:=False
Application.EnableEvents = True
Application.EnableEvents = False
Application.ActivePrinter = oldprinter