View Full Version : problems with printing

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, _
Application.EnableEvents = True
Application.EnableEvents = False
Application.ActivePrinter = oldprinter

08-07-2019, 08:18 AM
Comment out the "On Error Resume Next" and see if there's an error message